Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
zlib[docs]zlib implements the compression used by gzip, but not the file format. Instead, you should use thegzip module[docs]gzip module, which itself uses zlib.
import gzip
s = '...'
with gzip.open('/tmp/data', 'w') as f:
f.write(s)
zlib[docs] implements the compression used by gzip, but not the file format. Instead, you should use thegzip module[docs], which itself uses zlib.
import gzip
s = '...'
with gzip.open('/tmp/data', 'w') as f:
f.write(s)
zlib implements the compression used by gzip, but not the file format. Instead, you should use the gzip module, which itself uses zlib.
import gzip
s = '...'
with gzip.open('/tmp/data', 'w') as f:
f.write(s)