summaryrefslogtreecommitdiffstats
path: root/Demo/tkinter
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-04-10 11:46:37 (GMT)
committerGuido van Rossum <guido@python.org>1995-04-10 11:46:37 (GMT)
commit5b98ac5b14b7f01d24aecd3d371ed899ed3f671c (patch)
tree07843bf1112c3232216766b30702ddb8864f2c52 /Demo/tkinter
parent4e620374b8912342c0baf7391099c703cf55c0a7 (diff)
downloadcpython-5b98ac5b14b7f01d24aecd3d371ed899ed3f671c.zip
cpython-5b98ac5b14b7f01d24aecd3d371ed899ed3f671c.tar.gz
cpython-5b98ac5b14b7f01d24aecd3d371ed899ed3f671c.tar.bz2
added hello world
Diffstat (limited to 'Demo/tkinter')
-rwxr-xr-xDemo/tkinter/guido/hello.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/Demo/tkinter/guido/hello.py b/Demo/tkinter/guido/hello.py
new file mode 100755
index 0000000..237204f
--- /dev/null
+++ b/Demo/tkinter/guido/hello.py
@@ -0,0 +1,17 @@
+# Display hello, world in a button; clicking it quits the program
+
+import sys
+from Tkinter import *
+
+def main():
+ root = Tk()
+ button = Button(root)
+ button['text'] = 'Hello, world'
+ button['command'] = quit_callback # See below
+ button.pack()
+ root.mainloop()
+
+def quit_callback():
+ sys.exit(0)
+
+main()