gzip — Support for gzip files — Python 3.12.4 documentation

PHOTO EMBED

Sun Jul 28 2024 08:21:23 GMT+0000 (Coordinated Universal Time)

Saved by @Shook87

import gzip
content = b"Lots of content here"
with gzip.open('/home/joe/file.txt.gz', 'wb') as f:
    f.write(content)
content_copyCOPY

https://docs.python.org/3/library/gzip.html