Home / Python Tips Generated By ChatGPT / File Path Manipulation with os.path in Python Work with file paths in a platform-independent way. Source Code import os # Join parts of a file path path = os.path.join("folder", "subfolder", "file.txt") print(path) # Get the absolute path print(os.path.abspath(path))