Syntax Error
Manatee
markrrivet at aol.com
Sat Mar 19 00:39:20 EDT 2011
I hope this is the place to post this question. I am a really new
pythonista. I am studying Tkinter and when I run this basic code, I
get a syntax error on line 20, print "hi there, everyone". Its a
simple print line, but I can't see the problem. I am using Python
2.71, gVim for an editor, and a console window to execute the program.
Here is the link to the website that I am trying to follow:
http://www.pythonware.com/library/tkinter/introduction/hello-again.htm
Thanks for any help.
# File: hello2.py
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()
More information about the Python-list
mailing list