sys.exit call from pythonw.exe gives error

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

    #1

    sys.exit call from pythonw.exe gives error

    I wrote a python GUI with tkInter and installed it on a windows machine
    with the .pyw extension, so it will be executed from pythonw.exe instead
    of python.exe, since I didn't want the console window to appear.
    My application exits with a call to sys.exit. However, when this call is
    executed under pythonw.exe I get an error popup window with the
    following messeage:

    ---- start quote ----
    Microsoft Visual C++ Runtime Library
    Runtime Error!
    Program: C:\Python24\pyt honw.exe

    This application has requested the Runtime to terminate in an unusual way.
    Please contact the application support team for more information
    ---- end quote ----

    What am I doint wrong here?

    Jo



    --
    Dr Joachim Schambach
    The University of Texas at Austin
    Department of Physics
    1 University Station C1600
    Austin, Texas 78712-0264, USA
    Phone: (512) 471-1303; FAX: (814) 295-5111
    e-mail: jschamba@physic s.utexas.edu
  • jepler@unpythonic.net

    #2
    Re: sys.exit call from pythonw.exe gives error

    I wrote the following small program:
    #-----------------------------------------------------------------------
    import sys, Tkinter
    t = Tkinter.Tk()
    b = Tkinter.Button( command=lambda: sys.exit(0), text="Click to exit")
    b.pack()
    t.mainloop()
    #-----------------------------------------------------------------------
    and ran it with pythonw.exe from python 2.3.4 on a machine running Windows NT
    4.0. (I actually used Start > Run and entered "d:\python23\py thonw.exe x:\app.pyw"
    rather than clicking on the app.pyw icon, but this shouldn't make a difference)

    When the button is clicked, the application exits without giving any error like
    the one you described.

    Jeff

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.1 (GNU/Linux)

    iD8DBQFDYP5ZJd0 1MZaTXX0RAhycAJ wMz1iwumT9iKP/n51ExW38/qfDBACgnCHn
    RomJvAYSNpo9SnY 2pzWOwy8=
    =x7wc
    -----END PGP SIGNATURE-----

    Comment

    Working...