added hello world

This commit is contained in:
Guido van Rossum 1995-04-10 11:46:37 +00:00
parent 4e620374b8
commit 5b98ac5b14
1 changed files with 17 additions and 0 deletions

17
Demo/tkinter/guido/hello.py Executable file
View File

@ -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()