Reputation: 1981
Is there a way to call tkFileDialog.askdirectory()
without opening a parent tk window? This is annoying and (for me) goes unresponsive when I try to close it.
Thanks
Upvotes: 2
Views: 1754
Reputation: 16711
Unfortunately, you will need to instantiate a root window, but you can hide it programmatically.
from Tkinter import *
from tkFileDialog import *
root = Tk()
root.withdraw() # hide root
path = askdirectory()
root.mainloop()
Upvotes: 4