repo.or.cz
/
python
/
dscho.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Improved some error messages for command line processing.
[python/dscho.git]
/
Demo
/
tkinter
/
guido
/
hello.py
blob
237204fab8297a89bc080c030317ca7fe9a87d47
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
()