Guest User

Untitled

a guest
Aug 1st, 2017
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. import tkinter
  2. from tkinter import filedialog
  3. import os
  4.  
  5. root = tkinter.Tk()
  6. root.withdraw() #use to hide tkinter window
  7.  
  8. currdir = os.getcwd()
  9. tempdir = filedialog.askdirectory(parent=root, initialdir=currdir, title='Please select a directory')
  10. if len(tempdir) > 0:
  11. print("You chose %s" % tempdir)
Advertisement
Add Comment
Please, Sign In to add comment