September 2026
1051 pages
35h 4m
English
In addition to the modern pathlib, the standard library provides another set of functions for working with the file system via the os module. Although the use of pathlib is now preferred, these functions can be found in many code bases, which is why we would like to discuss them briefly here.
With the functions described ahead, you can navigate through the file system as you would with a shell or file manager, find information about files and folders, and rename, delete, or create them. To be able to execute the examples listed ahead, you must first import the os module:
>>> import os
You’ll often be able to pass a path as a parameter to the functions described. In this context, we distinguish between ...
Read now
Unlock full access