return codes from py2exe python script

T

Tim

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.
 
P

Peter Hansen

Tim said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top