Skip to content
Advertisement

Tag: python-zipfile

Python zipfile module: difference between zipfile.ZIP_DEFLATED and zipfile.ZIP_STORED

I have difficulty understanding the difference between zipfile.ZIP_DEFLATED and zipfile.ZIP_STORED compression modes of the zipfile module. Answer ZIP_DEFLATED correspond to an archive member (a file inside the archive) which is compressed (or deflated). ZIP_STORED correspond to an archive member which is simply stored, without being compressed, quite the same as an archive member inside a tar file.

create zip of complete directory using zipfile python module

Above is the code that I am using, and here “source” is the path of the directory. But when I run this code it just zips the source folder and not the files and and folders contained in it. I want it to compress the source folder recursively. Using tarfile module I can do this without passing any additional information.

Advertisement