[Tutor] tkinter.TclError

Peter Otten __peter__ at web.de
Sun Aug 14 08:51:31 CEST 2011


brandon w wrote:

> radio1 = Radiobutton(master=myapp, text="had breakfast", value="had
> breakfast", variable=relStatus, commmand=iClicked).pack()

> *Traceback (most recent call last):
>    File "tkwindow.py", line 54, in <module>
>      radio1 = Radiobutton(master=myapp, text="had breakfast", value="had
> breakfast", variable=relStatus, commmand=iClicked).pack()
>    File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 2732, in __init__
>      Widget.__init__(self, master, 'radiobutton', cnf, kw)
>    File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 1935, in __init__
>      (widgetName, self._w) + extra + self._options(cnf))
> _tkinter.TclError: unknown option "-commmand"*

Read the error message carefully. Hint: count the m-s.

By the way: the pack() method returns None; you cannot abbreviate

#correct
widget = Widget(...)
widget.pack(...)

with

#wrong
widget = Widget(...).pack(...)




More information about the Tutor mailing list