Open a ZIP file, where file can be either a path to a file
(a string) or a file-like object. The mode parameter
should be 'r' to read an existing file, 'w' to
truncate and write a new file, or 'a' to append to an
existing file. For mode is 'a' and file
refers to an existing ZIP file, then additional files are added to
it. If file does not refer to a ZIP file, then a new ZIP
archive is appended to the file. This is meant for adding a ZIP
archive to another file, such as python.exe. Using
cat myzip.zip >> python.exe
also works, and at least WinZip can read such files.
compression is the ZIP compression method to use when writing
the archive, and should be ZIP_STORED or
ZIP_DEFLATED; unrecognized values will cause
RuntimeError to be raised. If ZIP_DEFLATED
is specified but the zlib module is not avaialble,
RuntimeError is also raised. The default is
ZIP_STORED.
Return a list containing a ZipInfo object for each member of
the archive. The objects are in the same order as their entries in
the actual ZIP file on disk if an existing archive was opened.
Write the file named filename to the archive, giving it the
archive name arcname (by default, this will be the same as
filename). If given, compress_type overrides the value
given for the compression parameter to the constructor for
the new entry. The archive must be open with mode 'w' or
'a'.
Write the string bytes to the archive; meta-information is
given as the ZipInfo instance zinfo. At least the
filename, date, and time must be given by zinfo. The archive
must be opened with mode 'w' or 'a'.
The level of debug output to use. This may be set from 0
(the default, no output) to 3 (the most output). Debugging
information is written to sys.stdout.