Re: Can't get compression in Python zip script.

2005-05-02 Thread M.E.Farmer
Yea I get it now. I didn't realize that there where other possible un-implemented compression methods. Fredrik's post enlightened me. The problem was a false assumption that compression=0 in the arguments was == False seemed logical that compression=1 was True. Sometimes things aren't logical till

Re: Can't get compression in Python zip script.

2005-05-02 Thread Scott David Daniels
Fredrik Lundh wrote: > M.E.Farmer wrote: > >>I saw compression=0 and assumed that 1 would mean true, but no! >>zipfile.ZIP_DEFLATED = 8, defies logic, it is the only compression type >>why not accept any non zero as compression. > > "is the only compression type" ? quoting from the ZIP specifica

Re: Can't get compression in Python zip script.

2005-05-02 Thread M.E.Farmer
Thank you! """ZIP_DEFLATED The numeric constant for the usual ZIP compression method. This requires the zlib module. No other compression methods are currently supported.""" That is where I got the 'only compression type'. It all makes sense now. Thanks again, M.E.Farmer -- http://mail.python

Re: Can't get compression in Python zip script.

2005-05-02 Thread Fredrik Lundh
M.E.Farmer wrote: > I saw compression=0 and assumed that 1 would mean true, but no! > zipfile.ZIP_DEFLATED = 8, defies logic, it is the only compression type > why not accept any non zero as compression. "is the only compression type" ? quoting from the ZIP specification: compression metho

Re: Can't get compression in Python zip script.

2005-05-02 Thread M.E.Farmer
Steve Holden wrote: > [EMAIL PROTECTED] wrote: > > Hello, > > I following an example on how to zip files from the www.devshed.com > > site. > > I can create a zip package, however I am not getting any compression. > > 120M file stays 120M within the zip package. > > I need to know how to set or ac

Re: Can't get compression in Python zip script.

2005-05-02 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Hello, > I following an example on how to zip files from the www.devshed.com > site. > I can create a zip package, however I am not getting any compression. > 120M file stays 120M within the zip package. > I need to know how to set or activate the compression values. > h

Re: Can't get compression in Python zip script.

2005-05-02 Thread M.E.Farmer
zipfile.ZipFile.__init__(self, filename, mode='r', compression=0) Open the ZIP file with mode read "r", write "w" or append "a". >import zipfile >zip = zipfile.ZipFile('', 'w', compression=1) >zip.write('') >zip.close() Warning about zipfile module: In Python2.2 this is true, maybe 2.3 and 2.

Can't get compression in Python zip script.

2005-05-02 Thread [EMAIL PROTECTED]
Hello, I following an example on how to zip files from the www.devshed.com site. I can create a zip package, however I am not getting any compression. 120M file stays 120M within the zip package. I need to know how to set or activate the compression values. here is the code I'm using: >import zip