git: 9front

ref: 4bb9e229bcb23826a0fde907667c8fd6565d98d2
dir: /sys/src/cmd/python/Demo/tkinter/guido/hello.py/

View raw version
# 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()