[issue31309] Tkinter root window does not close if used with matplotlib.pyplot

Terry J. Reedy report at bugs.python.org
Wed Aug 30 12:52:57 EDT 2017


Terry J. Reedy added the comment:

This is purely a tkinter issue.  Windows people can ignore this.

Your problem was a result of your program error, of not keeping a reference to Tk(), combined with tkinter's _default_root 'feature'.

The solution you report in your answer, 'root = tkinter.Tk()', later followed by an explicit 'root.destroy()' is *the* correct way to do what you want.  I explained further in my answer.

There is no way for askopenfilename to know that you are done with root or tkinter._default_root.

----------
assignee: terry.reedy -> 
components:  -IDLE, Windows
nosy: +serhiy.storchaka
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
versions: +Python 3.7 -Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue31309>
_______________________________________


More information about the Python-bugs-list mailing list