return codes from py2exe python script

Discussion in 'Python' started by Tim, Sep 19, 2003.

  1. Tim

    Tim Guest

    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.
     
    Tim, Sep 19, 2003
    #1
    1. Advertising

  2. Tim

    Peter Hansen Guest

    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
     
    Peter Hansen, Sep 19, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Greg  --
    Replies:
    4
    Views:
    2,240
  2. F. GEIGER
    Replies:
    0
    Views:
    943
    F. GEIGER
    Aug 16, 2004
  3. python
    Replies:
    3
    Views:
    1,862
    Simon Brunning
    May 22, 2006
  4. Replies:
    2
    Views:
    2,933
    Malcolm
    Aug 20, 2005
  5. Allen
    Replies:
    1
    Views:
    676
    Mark Rae [MVP]
    Dec 3, 2007
Loading...

Share This Page