return codes from py2exe python script

Peter Hansen peter at
Fri Sep 19 22:50:50 CEST 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).


More information about the Python-list mailing list