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('<path/zipfilename.zip>', 'w', compression=1)
>zip.write('<path/filename.txt>')
>zip.close()

Warning about zipfile module:
In Python2.2 this is true, maybe 2.3 and 2.4 also have some problems.
You cannot remove/delete an entry from a zipfile with Python but you
can read and write it!
To do it you will have to make a new zip file that contains all the
files you want to keep and then overwrite the original.
You can have mulitple files with the same name!
Obviusly that can cause problems.
This can be very confusing.
hth,
M.E.Farmer

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to