Python Forum
Mac os choose file name - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Mac os choose file name (/thread-35973.html)



Mac os choose file name - howard687 - Jan-05-2022

I would like, on Mac Os, to invoke code that presents the user with a dialog (panel) to navigate directories/folders and choose a file. I believe the os supports something like "nsopenpanel" but have not located how to use that in a python program


RE: Mac os choose file name - Larz60+ - Jan-05-2022

tkinter also has: askopenfilename

usage:
from tkinter import filedialog as fd

filename = fd.askopenfilename()
print(filename)