ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/NinoCode/learning/tk1.py
Revision: 8
Committed: Sat May 5 04:21:19 2012 UTC (13 years, 10 months ago) by ninoborges
Content type: text/x-python
File size: 365 byte(s)
Log Message:
Initial Import

File Contents

# User Rev Content
1 ninoborges 8 from Tkinter import *
2     def doit():
3     print "hello"
4    
5     def gui(master):
6     top = Frame(master)
7     top.pack()
8     # the key to the command thing is to not put the () after the function call.
9     button = Button(top, text = "press me", command = doit)
10     button.pack(side=BOTTOM)
11     if __name__ == "__main__":
12     root = Tk()
13     gui(root)
14     mainloop()