Help Pliz ! stuck on page 4 of tutorial

Patrick Useldinger p at trick.lu
Sat Nov 22 05:06:19 EST 2003


Try this:

from Tkinter import *

class App:
   def __init__(self, master):    <========= name of constructor
      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