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

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

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,790
  2. F. GEIGER
    Replies:
    0
    Views:
    1,195
    F. GEIGER
    Aug 16, 2004
  3. Josh Close

    adns-python return codes

    Josh Close, Sep 3, 2004, in forum: Python
    Replies:
    2
    Views:
    603
    Sion Arrowsmith
    Sep 9, 2004
  4. python
    Replies:
    3
    Views:
    2,449
    Simon Brunning
    May 22, 2006
  5. Greenhorn
    Replies:
    15
    Views:
    1,137
    Keith Thompson
    Mar 6, 2005
  6. Replies:
    2
    Views:
    3,522
    Malcolm
    Aug 20, 2005
  7. Allen
    Replies:
    1
    Views:
    814
    Mark Rae [MVP]
    Dec 3, 2007
  8. Chris Spencer

    Re: [Py2exe-users] py2exe 0.6.9 released

    Chris Spencer, Nov 17, 2008, in forum: Python
    Replies:
    3
    Views:
    784
    Pascal
    Dec 8, 2008
Loading...