git: 9front

ref: 6fbb39a4cda53115b183cde8383fbd7a2400ff38
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()