return codes from py2exe python script

Peter Hansen peter at engcorp.com
Fri Sep 19 16:50:50 EDT 2003


Tim wrote:
> 
> Does anybody know how to get a return code or any errors from a python
> script that has been made into a exe using py2exe?  Right now when I
> run my script.exe it always returns 0 even if the script fails.

Use sys.exit() with an appropriate return value passed as an argument,
e.g. sys.exit(5).

-Peter




More information about the Python-list mailing list