[Tutor] Tkinter script error.

alan.gauld@bt.com alan.gauld@bt.com
Fri, 14 Jun 2002 12:18:13 +0100


> When I run the following Python script:

Is this actually cut n paste or did you retype it?

> 
>     def __init__(self, parent):
>         ....
>         b = Button(top, text="OK", command=self.ok)
>         b.pack(pady=5)
> 
> I get the following error:
> 
> Traceback (most recent call last):
>   File "(string)", line 22 in ?
>   File "(string)", line 11 in __init__

Indicates the problem is with the button.

> TclError: unkown option "-test"

Suggests you are trying to set an attribute called test 
which doesn't exist.
Could it be you have a typo in the real code whereby you 
set "test" instead of "text" as shown in the code above?

Just a thought.

Alan G.