]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
added hello world
authorGuido van Rossum <guido@python.org>
Mon, 10 Apr 1995 11:46:37 +0000 (11:46 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 10 Apr 1995 11:46:37 +0000 (11:46 +0000)
Demo/tkinter/guido/hello.py [new file with mode: 0755]

diff --git a/Demo/tkinter/guido/hello.py b/Demo/tkinter/guido/hello.py
new file mode 100755 (executable)
index 0000000..237204f
--- /dev/null
@@ -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()