from tkinter import Tk from tkinter.filedialog import askdirectory def getDirectory(**args): title = args.get("title", None) Tk().withdraw() return askdirectory(title=title) # getDirectory()