~ubuntu-branches/ubuntu/natty/python3.2/natty-security

« back to all changes in this revision

Viewing changes to Demo/tkinter/guido/hello.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2011-01-16 18:09:56 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20110116180956-yf91p6ode1z6lsi1
Tags: 3.2~rc1-0ubuntu1
Python 3.2 release candidate 1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Display hello, world in a button; clicking it quits the program
2
 
 
3
 
import sys
4
 
from tkinter import *
5
 
 
6
 
def main():
7
 
    root = Tk()
8
 
    button = Button(root)
9
 
    button['text'] = 'Hello, world'
10
 
    button['command'] = quit_callback       # See below
11
 
    button.pack()
12
 
    root.mainloop()
13
 
 
14
 
def quit_callback():
15
 
    sys.exit(0)
16
 
 
17
 
main()