Python tkinter – File browser as user input

Using tkinter will be creating a short script that will enable the user to browse to a file for user input. Tkinter is the standard GUI library for Python and provides a fast and easy way to create GUI applications.

The full source code for this project can be found below.

from tkinter import Tk     
from tkinter.filedialog import askopenfilename

Tk().withdraw() 
filename = askopenfilename() 
print(filename)

Leave a Reply