Mailing List Archive

MacPython: Tkinter vs. CLI
Guten Abend.

I'm learning Python using the excellent "Learning Python"
book by Mark Lutz and David Ascher. Unfortunately, it was
only necessary to read a few pages to hit something I'd
call strange behaviour in the Mac port:

--cut--
from Tkinter import *
w = Button(text="Hallo", command='exit')
w.pack()
w.mainloop()
--cut--

If I drop a file containing these lines on the Python
interpreter, it works as expected. But if I type it
in Python's CLI it opens an inactive and empty window
after line 2 and then the CLI stops reacting to keyboard
input. You can still quit the Python application via the
"Quit" menu item after clicking in the Tk window, then
it's possible to use File/Quit to exit the interpreter.

Useful information:

Python 1.5.2b1 (#47, Jan 13 1999, 15:14:59) [CW PPC w/GUSI
w/MSL]
Mac OS 8.6 (German), 25 MB allocated to Python

Cheers,
Nils
--
Lübeck, Germany - The Marzipan City
http://www.luebeck.de