can't run python gui with Tkinter

  • From: "Jaffar@xxxxxxxxxxxxx" <jaffar@xxxxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Fri, 15 Feb 2008 13:58:40 +0800

Hi all.  Need some advice from the python experts on the list.  I am learning 
Tkinter gui programming with python.  I am trying to build a hello world 
program with text messages and buttons.  I used Ed sharp to write the code and 
used the py dent facility that came with this fantastic editor.  However, I 
always get an indentation error on the third line of the code whose  content is:
def __init__(self, master)
when i try to run it.  Here is the whole code.  Any help will be appreciated.
Cheers!
Code below:
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()

Other related posts: