#!/usr/bin/env python3 from tkinter import filedialog from pathlib import Path testpath = Path(filedialog.askdirectory()) print(testpath)