Newbie: Tkinter and macPython

gt gtewalt at
Sun Jun 29 04:25:35 CEST 2003

I'm waffling between Ruby, and Python as a programming
I borrowed a friends book on Ruby, and have played with 
it a bit.
I went by the library to check out 'Learning Python'
but i was too late, the library had closed already...

Anyway, to the point.
I downloaded macPython for OSX, and was trying to get
a simpe Tkinter example to work form Lundh's tutorial,
I think it was.
Bu I get an error...

# File:

from Tkinter import *

root = Tk()
w = Label(root, text="Hello, world!")


error is:
'Tk' is not defined

and in the IDLE:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/",
line 140, in __call__
    codeob = compile(source, filename, symbol, self.flags, 1)
  File "<input>", line 1
     root = Tk()
 SyntaxError: invalid syntax

More information about the Python-list mailing list