What is the difference between incremental and one-shot compression?
问题 I am trying to use the bz2 and/or lzma packages in python. I am trying to compress a database dump in csv format and then put it to a zip file. I got it to work with one-shot compression with both the packages. Code for which looks like this: with ZipFile('something.zip', 'w') as zf: content = bz2.compress(bytes(csv_string, 'UTF-8')) # also with lzma zf.writestr( 'something.csv' + '.bz2', content, compress_type=ZIP_DEFLATED ) When I try to use incremental compression then it creates a .zip