Newbie Tkinter question
jerry keeney
jerryleekeeney at yahoo.com
Sat Jan 27 23:07:57 EST 2001
The following little program is giving me some
problems.
The problem is with self.button2. When this part of
code is commented out, the program works. When I
uncomment it out, like here: I get an invalid syntax
error for
self.button2.grid(row=1,column=1)
What obvious thing am I missing here?
# File: hello2.py
from Tkinter import *
class App:
def __init__(self, master):
self.button = Button(text="QUIT", fg="red")
self.button.grid(row=0,column=0)
self.hi_there = Button(text=
"Hello",command=self.say_hi)
self.hi_there.grid(row=0,column=1)
self.button2 = Button(text="test", fg="red")
self.button2.grid(row=1,column=1)
def say_hi(self):
print "hi there, everyone!"
root = Tk()
app = App(root)
root.mainloop()
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/
More information about the Python-list
mailing list