return codes from py2exe python script

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tim

    return codes from py2exe python script

    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.
  • Peter Hansen

    #2
    Re: return codes from py2exe python script

    Tim wrote:[color=blue]
    >
    > 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.[/color]

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

    -Peter

    Comment

    Working...