cpython/Demo/tkinter/guido/hello.py

18 lines
304 B
Python
Raw Normal View History

1995-04-10 11:46:37 +00:00
# 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()