simple python script to zip files
Tim Chase
python.list at tim.thechases.com
Sat Feb 16 14:52:49 EST 2008
> Thanks! Works indeed. Strange thing is though, the files created are the
> exact size as the original file. So it seems like it is zipping without
> compression.
The instantiation of the ZipFile object can take an optional
parameter to control the compression. The zipfile module only
supports storing (the default as you discovered) and "deflation":
f = zipfile.ZipFile(zipfilename, 'w',
compression=zipfile.ZIP_DEFLATED)
You can read more at
http://docs.python.org/lib/zipfile-objects.html
-tkc
More information about the Python-list
mailing list