Solved! Go to Solution.
I need to see is a log showing the success or failure of the Python portion of the code.
Is there a way of getting Python to dump a log file out to specific location while it is running in SAS?
try: ... do your work ... except Exception, msg: errMsg = "script failed\n" + str(msg) # write a message to gp out arcpy.AddError(errMsg) # print a message to stdout print "** " + errMsg # write to a log file f.open("c:\\temp\\out.txt","w") f.write(errMsg + "\n") f.close()
I need to see is a log showing the success or failure of the Python portion of the code.
Is there a way of getting Python to dump a log file out to specific location while it is running in SAS?
try: ... do your work ... except Exception, msg: errMsg = "script failed\n" + str(msg) # write a message to gp out arcpy.AddError(errMsg) # print a message to stdout print "** " + errMsg # write to a log file f.open("c:\\temp\\out.txt","w") f.write(errMsg + "\n") f.close()