Asked By – Mustafa Zengin
I would like to get file path as input in my Python console application.
Currently I can only ask for full path as an input in the console.
Is there a way to trigger a simple user interface where users can select file instead of typing the full path?
Now we will see solution for issue: Choosing a file in Python with simple Dialog
How about using tkinter?
from Tkinter import Tk # from tkinter import Tk for Python 3.x from tkinter.filedialog import askopenfilename Tk().withdraw() # we don't want a full GUI, so keep the root window from appearing filename = askopenfilename() # show an "Open" dialog box and return the path to the selected file print(filename)