python - TKinter tkFileDialog.askopenfilename Always behind other windows -
i want create simple tkinter file selection dialog function use other scripts , not wider gui.
my current code is:
# select single file , return full path string def select_file(data_dir): chdir(data_dir) root = tkinter.tk() root.withdraw() file_path = tkfiledialog.askopenfilename() return file_path
when run file dialog behind other windows. if have spyder maximised, opens behind have minimise.
there few questions related this, i've been unable of suggested code work, apologies if viewed duplicate question.
ben
just have use root.deiconify()
after file_path = tkfiledialog.askopenfilename()
but it's bad idea create new tk
here.
Comments
Post a Comment