from pathlib import Path path = Path("D: est") temp = path.rename("Enter new folder name") new_path = temp.absolute()