1

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 1

4

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

Sign up to request clarification or add additional context in comments.

1 Comment

In python 3, the API changed a little, so the dialog is now tkinter.filedialog.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.