gzip — Support for gzip files — Python 3.14.7 documentation

docs.python.org

Tin mới

zlib — Compression compatible with gzip

bz2 — Support for bzip2 compression

Python Module Index

3.14.7 Documentation

The Python Standard Library

Data Compression and Archiving

Examples of usage¶

This module provides a simple interface to compress and decompress files just like the GNU programs gzip and gunzip would.

Requirements for optional modules

This module provides a simple interface to compress and decompress files just like the GNU programs gzip and gunzip would.

io.IOBase.truncate

Constructor for the GzipFile class, which simulates most of the methods of a file object, with the exception of the truncate() method. At least one of fileobj and filename must be given a non-trivial value.