Introduction


pathlib is a Python module introduced in Python 3.4 (2014) by Antoine Pitrou.
It provides an object-oriented interface to work with filesystem paths,
making code more readable and intuitive compared to traditional os.path functions.

 

Cross-platform compatibility note
pathlib handles differences in path separators (/ vs \) automatically, making scripts more portable between operating systems.

 

 

from pathlib import Path

Python


23 Sept. 2025 | Last Updated: 22 Nov. 2025 | jaimedcsilva

Related
  • Introduction
  • Create and manipulate paths
  • Exists, type and file informations

  • Buy Me a Coffee