I was wondering if there is something similar to Java's JFileChooser
for Python?
JFileChooser
is a graphical front end to choose a file.
Preferably something that is already with Python. Maybe with Tkinter.
wxPython (www.wxpython.org) provides the wx.FileDialog class which will give you a native file selection dialog on any of the supported platforms (Mac, Linux or Windows).
Easiest way I ever found to do this (using PyGTK and Kiwi):
from kiwi.ui.dialogs import open as open_dialog
chosen_path = open_dialog('Select a file', folder='/start/folder')
if chosen_path is not None:
# do something ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With