February 2006
Intermediate to advanced
648 pages
14h 53m
English
The zipfile module is used to manipulate files encoded in the popular zip format (originally known as PKZIP, although now supported by a wide variety of programs). The following functions are available:
is_zipfile(filename)
Tests filename to see if it’s a valid zip file. Returns True if filename is a zip file; returns False otherwise.
ZipFile(filename [, mode [, compression]])
Opens a zip file, filename, and returns a ZipFile instance. mode is 'r' to read from an existing file, 'w' to truncate the file and write a new file, or 'a' to append to an existing file. For 'a' mode, if filename is an existing zip file, new files are added to it. If filename is not a zip file, the archive is simply appended to the end of the file. compression ...
Read now
Unlock full access