Tkinter help on MacOSX please.

SA sarmstrong13 at
Fri Jun 7 20:10:01 CEST 2002

Hi Everyone-

    I've installed python, tcl, tk on my MacOSX 10.1.5 system using the
--enable-frameworks configuration. I have a framework for tcl,tk,and python
under my /Library/Frameworks directory. When I run a simple button code in a
python script:

#!/usr/bin/env python

import sys
from Tkinter import *

def die(event):

root = Tk()
button = Button(root)
button["text"] = "Hello"
button.bind("<Button-1>", die)

I get the following output in my shell(tcsh by the way):

original argc=2
original argv[0] = "python"
original argv[1] = "./"
modified argc=2
modified argv[0] = "python"
modified argv[1] = "./"

Nothing happens.

So I then hit Ctrl-C to stop the script and I get the following Traceback

Traceback (most recent call last):
  File "./", line 14, in ?
"/Library/Frameworks/Python.framework/Versions/2.2/lib/python2.2/lib-tk/Tkin", line 929, in mainloop

It looks like it is calling the correct Tkinter Module, but nothing is bein
displayed. If however I enter the code line for line in the that
I compile, I get the proper button widget. Maybe I'm wrong (because I
definitely do NOT fully understand the Mac OSX Frameworks system yet), but
if the coded is properly calling the correct Tkinter module, it should not
matter whether or not it is done within the or by calling python
from within Is this correct? Is there a way to do this on a Mac?
(other than MacPython wich works only on pre OSX systems and doe not take
advantage of the BSD under OSX)


More information about the Python-list mailing list