I am writing a small program to enter a file name in an entry dialog in python tkinter. The code currently using a entry dialog which lets me put in a file name manually. However, I wish to use the file browser kind of feature in place of manual typing in of the file. To add on, I wish to not open the file in the dialog itself but rather store the entire path to a variable. Is it possible to do so?
1 Answer
Use tkFileDialog.askopenfilename(), as described in a tkinter.unpythonic.net webpage.
askopenfilename(**options) gets a name or names and has options defaultextension, filetypes, initialdir, initialfile, multiple, message, parent, title
1 Comment
aluriak
In python 3, the API changed a little, so the dialog is now
tkinter.filedialog.