myhotchoc
myhotchoc

Reputation: 11

tkinter.TclError: invalid command name ".52674064

I am trying to run a Tkinter GUI on Python 3.x and When I use the .get command to get the number off a scale, this error pops up

Exception in Tkinter callback Traceback (most recent call last): File "C:\Python34\lib\tkinter\__init__.py", line 1482, in __call__ return self.func(*args) File "C:\Users\Danny\Downloads\Space RPG. Alpha 0.2 (2) (1).py", line 39, in close print (w1.get(), w2.get()) File "C:\Python34\lib\tkinter\__init__.py", line 2840, in get value = self.tk.call(self._w, 'get') _tkinter.TclError: invalid command name ".52674064"

What is happening?

Upvotes: 0

Views: 828

Answers (1)

Bryan Oakley
Bryan Oakley

Reputation: 385800

That usually means that you're trying to call a method on a widget that has been destroyed. The string .52674064 is the internal name of a specific widget.

This can easily happen if you call a function via a binding or via after, if the widget is destroyed before the binding or after call has been triggered.

Upvotes: 1

Related Questions