I can do the following in my program to get a simple open file dialog and print the selected file path. Unfortunately it doesn\'t go away right away when the user selects t
Exactly the problem I had - sometimes the file dialog would go away after a while, sometimes not. But it always seemed to block a later status windows. Adding the root.update() fixed both problems immediately.
I was having some trouble with Tkinter dialog boxes. Like you, the dialog just sat there after I had selected a file. I didn't try leaving it for very long, it may have disappeared after 5 minutes as you said your's did. After lots of random experimentation I found that calling root.update()
before the askopenfilename()
line seemed to fix it.
For reference, this is the code I was testing with:
import sys
from tkinter import *
from tkinter import filedialog
#instantiate a Tk window
root = Tk()
#set the title of the window
root.title('Tk test')
#dunno what this does, fixes askopenfilename if I use it.
root.update()
print(filedialog.askopenfilename(title='dialogue? surely.'))