Subject: MacPython-OS9 2.2.3 & Tkinter

Charles Starrett cdstarrett at yahoo.com
Mon Aug 4 23:24:46 EDT 2003


I am a just a dabbler in programming, but I'd like to make some simple
cross-platform tools for generating webpages, as well as for text
munging.  One thing I need is a  Mac OS 9/Windows GUI solution.  I
thought that Tkinter could provide this, but I'm having trouble
getting the simple test script from Learning Python p.22 to work under
Mac OS 9 (9.2.2, on a 400 MHz PowerBook firewire/2000, 192 MB ram).

Starting with a clean install of MacPython 2.2.3, I run
ConfigurePythonClassic, and then launch PythonInterpreter.  This is
how far I get:

Python 2.2.3 (#139, Jun  1 2003, 21:54:44)  [CW PPC GUSI2 THREADS GC]
on mac
Type "copyright", "credits" or "license" for more information.
>>> from Tkinter import *
>>> w = Button(text="Hello", command='exit')

Then I get just a blinking cursor on the following line and nothing
else happens.  The OS hasn't frozen at that point, but the interpreter
doesn't return any prompt (neither >>> nor ...).  I can't quit out of
PythonInterpreter except to "force quit."  The menus respond visually
but produce no result.  <ctrl-D> doesn't terminate the interpreter
either.  If I don't force it to quit, the interpreter eventually
(after 5-10 minutes) "quits unexpectedly" on its own. ONCE I was able
to work all the way through the script to w.mainloop() but neither the
button ("Hello") nor the window widgets responded to mouse clicks, and
again I had to force quit the interpreter.  I've also tried increasing
the memory Preferred Size for PythonInterpreter but that didn't appear
to help.

My question is, does Tkinter actually work on OS 9?  Is there a
problem with this test script, or do I need to look elsewhere for my
cross-platform needs?  (The only other solution I have found is PLT
Scheme, which I like, but I'd like to give Python a try...)

Thanks for any help...

~~Charles




More information about the Python-list mailing list