September 2026
1051 pages
35h 4m
English
If your programs need to process large amounts of data, it often doesn't make sense to keep all the data in the memory at once. For this purpose, you can use temporary files, which allow you to temporarily move data that isn’t currently needed to the hard drive. However, temporary files are not suitable for storing data permanently.
For convenient handling of temporary files, Python provides the tempfile module.
The most important function of this module is TemporaryFile, which returns an open file object associated with a new temporary file. The file is opened for read and write access in binary mode ("w+b"). We as users of the function don’t need to worry about anything other than reading and writing our data. ...
Read now
Unlock full access