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

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top