Error: _tkinter.TclError: can't invoke "wm" command: application has been destroyed Error: _tkinter.TclError: can't invoke "wm" command: application has been destroyed tkinter tkinter

Error: _tkinter.TclError: can't invoke "wm" command: application has been destroyed


All that message means is that you're calling one of the "wm" commands (eg: wm_title, wm_geometry, and a few others) after you've destroyed the root window. (note: "geometry" and "title" are simple shortcuts to "wm_geometry" and "wm_title").

You're using tkinter in a highly unusual way. Tkinter was designed for you to create a single instance of Tk, and call mainloop exactly once. Is there a reason why you need to stop and start Tkinter multiple times in the course of your application? If all you need to do is pop up some modal dialogs and wait for the user to enter data, you can do that without creating a new instance of Tk every time.