By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,907 Members | 1,963 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,907 IT Pros & Developers. It's quick & easy.

sys.exit call from pythonw.exe gives error

P: n/a
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: js******@physics.utexas.edu
Oct 27 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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-----

Oct 27 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.