Reputation:
I want to find the string value of the directory in Python where a few files are located. Then, I plan on using os.listdir
to continue on with the script. I've tried using tkFileDialog
to use askdirectory
, but not luck.
Upvotes: 1
Views: 9563
Reputation: 3974
tkFileDialog changed with Python 3.x, it's now tkinter.filedialog
, a module of tkinter
Here's how to import it:
from tkinter.filedialog import askdirectory
folder = askdirectory()
Refer to: http://docs.python.org/3.0/library/tkinter.html#tkinter-modules
Upvotes: 10