Returning errors from IronPython

Hey there,
I’m calling nuke from an IronPython script, and sometimes it fails due to a license error. I’m trying to flag this to deadline. Is there an easy way to do that with ironPython? For example:

nukeCmd = ‘“C:/Program Files/Nuke6.0v6/Nuke6.0.exe”’
nukeArgs = “-t path_to_the_best_python_script_ever_made.py”
Process.Start(nukeCmd,nukeArgs)

Can you suggest a way to grab the error code from Nuke, if the script fails, and pass it to deadline? I searched on the interwebs, but have not found anything, and I suspect someone here has done this before.

Thanks for any help!

Seth

Hi Seth,

Process.Start() returns a .NET Process object:
msdn.microsoft.com/en-us/library … ocess.aspx

If you check its properties here, you’ll see it has an ExitCode property:
msdn.microsoft.com/en-us/library … mbers.aspx

Hopefully that’s all you need to determine that something went wrong.

Cheers,

  • Ryan

Thank you Ryan, I’ll give it a whirl.