from pathlib import Path # Create a Path object path = Path("main.py")