Python Tkinter Error Object Has No Attribute
So I am making a program similar to the arcade games. I want the lableGuess to appear in the toplevel window after clicking the frame but it gives me this error: AttributeError: 'W
Solution 1:
First at all, you should never create a new attribute out of the __init__
method.
That said, Mike pointed the trouble’s reason: you created the window object inside the new_window
method, but did not called it.
You must call new_window
before call guess_number
– or call one inside other.
I suggest that you set window
to None
and call new_window
inside __init__
method, then (after that) call guess_number
.
Post a Comment for "Python Tkinter Error Object Has No Attribute"