Why You Should Start Using Pathlib as an Alternative to the OS Module

First reason: object-oriented programming

Ahmed Besbes
Towards Data Science
6 min readDec 16, 2021

--

Image made by the author

As a data scientist, I manipulate paths and files on a daily basis to read and write data.

To do this, I typically use the os.path Python module to perform operations such as joining paths, checking the content of a directory, or creating folders.

--

--

Medium Top Writer (+2M views) | I write about python and productionizing ML code into scalable apps. Exclusive content here: https://thetechbuffet.substack.com/