sys.exit call from pythonw.exe gives error

J

Jo Schambach

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\pythonw.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: (e-mail address removed)
 
J

jepler

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\pythonw.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)

iD8DBQFDYP5ZJd01MZaTXX0RAhycAJwMz1iwumT9iKP/n51ExW38/qfDBACgnCHn
RomJvAYSNpo9SnY2pzWOwy8=
=x7wc
-----END PGP SIGNATURE-----
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top