Win98 IDLE misbehaves with Tkinter tutorial code

JDonner jdonner0 at earthlink.net
Sun Oct 10 00:44:37 EDT 1999


Hi,

  The latest standard IDLE
(installed from the python.org windows py152.exe, with Tcl/Tk):
"
Python 1.5.2 (#0, Apr 13 1999, 10:51:12) [MSC 32 bit (Intel)] on win32
"

fails to return from this, the first hello world example in the 
pythonware tkinter tutorial:

from Tkinter import *
root = Tk()
w = Label(root, text="Hello, world!")
w.pack()
root.mainloop()

Ie it shows the window, & the close button works & 
the dialog goes away but IDLE acts like the program is still 
running, ie no new prompt shows up.  Is this something wrong with 
my configuration, perhaps?  It works as it should from the plain 
command line.  

Now when I installed the first time I had a more recent version 
of Tcl/Tk but since then I've cleaned both Tcl/Tk & Python 
out completely & reinstalled both purely from the py152.exe, 
but that hasn't changed anything.  

In this second tutorial tkinter example, run from both IDLE & 
the plain command line, the quit button causes the prompt 
>>> to return, but the window stays up!  Here's the 2nd example:

from Tkinter import *
class App:
  def __init__(self, master):
    frame = Frame(master)
    frame.pack()
    self.button = Button(frame, text="QUIT", fg="red",
command=frame.quit)
    self.button.pack(side=LEFT)
    self.hi_there = Button(frame, text="Hello", command=self.say_hi)
    self.hi_there.pack(side=LEFT)

  def say_hi(self):
    print "hi there, everyone!"

root = Tk()
app = App(root)
root.mainloop()


thanks for any help,

JDonner





More information about the Python-list mailing list