summaryrefslogtreecommitdiffstats
path: root/Demo/tkinter/guido/hello.py
blob: 237204fab8297a89bc080c030317ca7fe9a87d47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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()