newbie: why it does not work: command=sys.exit?

Paul van Dam paul.van.dam at planet.nl
Sun May 23 18:54:53 EDT 2004


I have got a problem with een example from the book "Programming Python" -
Mark Lutz
I do not understand why it not work for Windows XP and Linux (Fedora Core
1.0).
Exactly the same problem was raised by DrPhil:
http://coderforums.com/showthread.php?s=16f49a79ed298097f695b0a5fcb27197&threadid=2615&goto=nextoldest

import sys
from Tkinter import *
widget = Button(None, text='Hello widget world', command = sys.exit)
widget.pack()
widget.mainloop()
----------------------------------------------------------------------------
--------
Traceback (most recent call last):
  File "I:\Python\Projecten\#Prog_in_Python\Hfst06\gui02.py", line 5,
in -toplevel-
    widget.mainloop()
  File "D:\Python23\lib\lib-tk\Tkinter.py", line 965, in mainloop
    self.tk.mainloop(n)
  File "D:\Python23\lib\lib-tk\Tkinter.py", line 1347, in __call__
    raise SystemExit, msg
SystemExit





More information about the Python-list mailing list