compressed_file_mod module

A module for reading and writing (sometimes) compressed files.

Note that everything is stored in memory - in fact, sometimes there’ll be the uncompressed data and compressed data in memory at the same time. So this is not for huge files, but works fine for tens or even hundreds of megabytes.

class compressed_file_mod.Compressed_file(filename, mode, perms=None, start_empty=False, zero_length_ok=False)[source]

Bases: object

A class for dealing with compressed files.

close()[source]

Close the file.

read(length=None)[source]

Read bytes from our ‘file’.

write(data)[source]

Write bytes to our ‘file’.