Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: 586547387b468ffb391cb76842f65e68164e5135 authored by Benjamin Peterson on 16 August 2009, 21:59:05 UTC
bump to 3.1.1
Tip revision: 5865473
hello.py
# 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()
back to top