January 2023
Intermediate to advanced
472 pages
17h 59m
English

Files let you store data in a persistent and sharable manner. It’s all but impossible to do any real work without them. Python comes with many modules and methods for working with files, folders, and directory paths. These let you read and write text files; preserve complex data after you exit your program; create, move, and delete folders; and perform other system-level tasks.
In this chapter, we’ll use the built-in operating system (os), path library (pathlib), and shell utilities (shutil) modules to work with files, folders, and directory paths. We’ll then use built-in functions to open, read, write, and close text files, ...
Read now
Unlock full access