Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tkinter
- from tkinter import filedialog
- import os
- root = tkinter.Tk()
- root.withdraw() #use to hide tkinter window
- currdir = os.getcwd()
- tempdir = filedialog.askdirectory(parent=root, initialdir=currdir, title='Please select a directory')
- if len(tempdir) > 0:
- print("You chose %s" % tempdir)
Advertisement
Add Comment
Please, Sign In to add comment