473,325 Members | 2,774 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,325 software developers and data experts.

Simple problem with GUI!!

Hello Guys,

I am a beginner with Python programming and would like to implement
some GUI functionalities along with my main work. So I was trying to
implement one basic program (available from books).
Here is the code,

############################
import Tkinter

TopLevelWindowObj = Tkinter.Tk() # Creating a root window
QuitObj = Tkinter.Button(TopLevelWindowObj, text = "QUIT", command =
TopLevelWindowObj.quit) # Creating a Button
QuitObj.pack() # Positioning the button
Tkinter.mainloop()
#############################

So, this is a code to display a window with a "QUIT" button and by
clickign the button the entire window is closed. When I execute this
program, the window does not close down but the window is completely
disabled and after a few seconds I get the following message in a
message window,

************************************************** ************************
Message box name - Microsoft Visual C++ Runtime Library

Runtime Error!

program...\Python22\core\lib\site-packages\Pythonwin\Pythonwin.exe

This application has requested the Runtime to terminate it in an
unusual way.
Please contact the application's support team for more information.

************************************************** **********************************
At the end I had to close down my entire python compiler. I am using
Python compiler with following specs in Windows XP OS.

Pythonwin - Python IDE and GUI Framework for Windows.
PythonWin 2.2.1 (#34, Feb 25 2003, 11:29:09) [MSC 32 bit (Intel)] on
win32.
Portions Copyright 1994-2001 Mark Hammond

Please let me know why is this happening and also if I am missing
something in the way of programming.

Thanks in advance.

Cheers,
Mohan.

Oct 27 '06 #1
1 1875
"mohan" wrote:
At the end I had to close down my entire python compiler. I am using
Python compiler with following specs in Windows XP OS.

Pythonwin - Python IDE and GUI Framework for Windows.
PythonWin 2.2.1 (#34, Feb 25 2003, 11:29:09) [MSC 32 bit (Intel)] on
win32.
Portions Copyright 1994-2001 Mark Hammond

Please let me know why is this happening and also if I am missing
something in the way of programming.
the PythonWin IDE doesn't work properly when you're running programs that
does their own Windows event handling. this is a problem with PythonWin, not
with Tkinter or your program. to solve this, you can either

1) check if you can make PythonWin run the program in a separate process

2) explicitly run the program in its own process (using "python.exe" or "pythonw.exe"),
from the command line.

3) switch to an IDE that runs Python code in a separate process (such as IDLE,
Wing, and most other modern IDE:s).

</F>

Oct 27 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Al Bogner | last post by:
Since weeks I am searching the net from time to time how to build a small MYSQL-Frontend for a simple small database. The last decision ist not made, but it looks like, that I will learn Python. ...
5
by: Jonathon McKitrick | last post by:
Hi all, I am totally hooked on what I have learned about python. I am going to use it to develop a simple data entry app I need for some financial record keeping. I understand tkinter is...
0
by: engsolnorm | last post by:
A co-worker and I want to increase our knowledge of Python. I have a tiny bit of exposure to python. He has none, but has wide experience with C, C++, NET, C#, etc. We agreed we'd do a Sudoku...
1
by: keke3905 | last post by:
I really would appreciate some help on this assignment. I need to make GUI boxes to display the system info such as on Microsoft Office. I have some code but not sure where to go with the rest of...
3
noylec
by: noylec | last post by:
Hi... I'm new in Java programming. Can you please help me in creating a program using GUI (specifically, using swing)? Here is the problem given: Create a program using GUI (swing) that will ask...
0
nomad
by: nomad | last post by:
I made a simple GUI program in which I want to place a .gif into a button. I did this but the .gif does not show up. The load.gif is in the same package (chapter 10) as the project. If I take these...
2
by: Davy | last post by:
Hi all, How to debug Python program with GUI, especially Tkinter? My debug environment is PythonWin. For example, when I single step in the program, the step will go to mainloop() and always...
7
by: dave | last post by:
Hi All. I've been formulating in my head a simple image editor. I actually started prototyping is some time ago in Java, but am liking Python more and more. My editor will be nowhere near the level...
2
by: vimalsantoki | last post by:
Any one please help me in c#. I want to start a GUI process in remote machine using c#.net. I have develop one windows application for LAN in which I provide a facility of remote process start...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.