Part of the issue you are running into is because you are using a python interpreter but you need Automics to convert the password.
First I would rewrite this to be a python script, such as myscript.py and have it accept arguments being passed in, those will be the username, password and token. You would need to call it via &UC_JOBMD CMD
Example process tab
&UC_JOBMD CMD="python myscript.py &USERNAME# &PASSWORD# &TOKEN#"
Example script contents for myscript.py
import os
import sys
import subprocess
uid = int(sys.argv[1])
pwd= int(sys.argv[2])
tkn= int(sys.argv[3])
print ("uid is the username, pwd is the password, tkn is the token")