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 heihei(self, )
def say_hi(self):
w = Label(root, text="hello,world!")
w.pack()
print "hello, world!"
root=Tk()
app = App(root)
root.mainloop()
第一次寫Phyton離的Tkinter,挺好的,加油加油
转载于:https://my.oschina.net/dianpaopao/blog/97113