Hello, I am new to Python and I am just starting to figure things out but this one has me stumped.
I need to capture the exit code of my processes in order to track them in a database. I have all the other components working except this. In DOS I use:
Echo %errorlevel%
then post the value of %errorlevel% to the SQL table by calling a CF page and passing the value in the URL.
Is there a way to calculate %errorlevel% with the exit code of the process in Python? I need Python to set %errorlevel% equal to the exit code. I’m pretty sure that ‘%’ is not the proper syntax in Python to designate a variable but, as I said, I’m new. Below is the Python code that I am using to open the CF page that inserts the data to SQL.
opener = urllib.FancyURLopener({})
n_url = opener.open('http://cob/gis/GISAutoProcess_Action.cfm?ProcessID=000&ErrorCode=%errorlevel%')
for line in n_url.readlines():
print line
Thanks in advance for your help.