473,385 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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\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
1 2933
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Eric Ching | last post by:
Can I run pythonw with a script that takes command line arguments then launches a GUI? I try pythonw myscript.pyw -option arg (etc.) and nothing happens. Nothing, as in I am immediately returned...
3
by: vm_usenet | last post by:
Hi everyone, I've seen this subject come up in another thread, but not getting enough attention - so I'll just ask it: When running python code via pythonw, what exactly happens to stderr? I...
1
by: Guinness Mann | last post by:
Pardon me if this is not the optimum newsgroup for this post, but it's the only .NET newsgroup I read and I'm certain someone here can help me. I have a C# program that checks for an error...
5
by: pafgbs | last post by:
I wanted to use some of my MFC stuff in a new C# applikation, so I made an activeX/ocx of my a database viewer. Tested ocx i VB 6.0 and MFC app, worked fine. Tested ocx i a C# .NET app, and upon...
3
by: Mike Johnson | last post by:
I have the following code in form1 and when the application starts this sub is called to check for a path if not found a message box is displayed and then gives the user an option to end the...
2
by: GGerard | last post by:
Hello Is there a way to exit all running procedures with one command? Sometimes a procedure(1) will call another procedure(2) which could call a third procedure(3) and what I would like to...
4
by: Mike C# | last post by:
Hi all, quick question. I have an application I'm running. There are some "fatal" error conditions that could occur during processing, and I want to exit immediately if one comes up. When I put...
4
by: Siam | last post by:
Hi all, I have a big application that does all sorts of network and video processing related functions. On closing the program, Windows gives me the "This program has encountered an error and...
3
by: Matthew Fitzgibbons | last post by:
I've got a pretty complex interactive command line program. Instead of writing my own REPL, I'm using the Python interpreter (an infinitely better solution). This program has two threads, a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.