473,382 Members | 1,733 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,382 software developers and data experts.

Tk windows in w2k IDLE don't close

Hi -

I wrote this program:

import Tkinter

root = Tkinter.Tk()
root.title('tkfun is tktastic!')
cc = Tkinter.Canvas(root, width=400, height=400, bg="white")

for x in range(0,400,20):
color = "#%x%x%x" % (x*12,x*12,x*12)
rect = (x,x,x+20,x+20)
cc.create_rectangle(rect, fill=color)

cc.pack()
root.mainloop()

I write all that in an idle window and then hit f5 to run it. The window
pops up ok, but after I close it, I still don't get my python interactive
session back. If I try to close that window, I get a message saying the
program is still running. What am I doing wrong?

Thanks in advance.

Jul 18 '05 #1
1 2033

"Matthew Wilson" <mw*****@sarcastic-horse.com> schrieb im Newsbeitrag
news:ma**********************************@python.o rg...
| Hi -
|
| I wrote this program:
|
| import Tkinter
|
| root = Tkinter.Tk()
| root.title('tkfun is tktastic!')
| cc = Tkinter.Canvas(root, width=400, height=400, bg="white")
|
| for x in range(0,400,20):
| color = "#%x%x%x" % (x*12,x*12,x*12)
| rect = (x,x,x+20,x+20)
| cc.create_rectangle(rect, fill=color)
|
| cc.pack()
| root.mainloop()
|
| I write all that in an idle window and then hit f5 to run it. The window
| pops up ok, but after I close it, I still don't get my python interactive
| session back. If I try to close that window, I get a message saying the
| program is still running. What am I doing wrong?

Try uncommenting "root.mainloop()" as long as your testing/developing in
IDLE.

HTH
Vincent Wehren

|
| Thanks in advance.
|
Jul 18 '05 #2

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

Similar topics

0
by: Fuzzyman | last post by:
At least I've been advised by the 'officials' (in response to my bug report at sourceforge) to only start IDLE with the '-n' argument because sub-processes 'don't work' on windows. In fact the...
5
by: StepH | last post by:
Hi, I'm new to Python. I'm working under XP, and I've alot of prob. (not with the langage itself, but with the tools): I've install Pyhton 2.4 in C:\Python24, using the .msi windows...
0
by: Brian van den Broek | last post by:
Hi all, IDLE refuses to launch, and I believe it is because I attempted to define a custom key-binding that it doesn't like. I was recently defining a custom keybinding in IDLE 1.1 under...
8
by: Jonathan Polley | last post by:
I have one account on a WindowsXP machine that refuses to run IDLE (or any other python script that uses Tk). Other people can login to that PC and IDLE runs just fine, so it is not an...
1
by: jdph40 | last post by:
I am using Access 2002. I downloaded the forms sample database FrmSmp97.mdb from Microsoft and used the following code in the timer event of a hidden form in order to close a database if no...
6
by: Jon Hyland | last post by:
Ok, I'm a little rusty on this, it should be a simple problem but I can't figure it out. How can I handle form events in my main code page?? I'm creating a Windows App in C#. Rather than make...
0
by: Stefan Felkel | last post by:
hi! i have searched a lot in these pgsql-groups and on the internet, but found no really helpful information for my problem. the famous error >> database "xyz" is being accessed by other...
4
by: Josh Close | last post by:
Is there a way to remove idle connections? My postgres server is getting serveral hundred idle connections. It's due to a postgres .NET provider not closing the connections properly. I don't want...
5
by: Chakravarti Mukesh | last post by:
Hi, I want to get an event if someone locks her/his computer so that I could do some finalizations before actually locking the system. For example how can I ensure that an user close a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.