file compression

Elaine Jackson elainejackson7355 at
Tue Jun 29 09:07:27 CEST 2004

Maybe I'm just dense but I can't figure out how to UNzip a zip file with the
code from the zipfile module. Would you mind showing me what that would look

"Skip Montanaro" <skip at> wrote in message
news:mailman.257.1088478149.27577.python-list at
|     Elaine> The files I'm working with are python modules and LaTeX source
|     Elaine> files, and I need to make them into archives so I can store them
|     Elaine> in my website.
| Check out the zipfile module and class:
|     % pydoc zipfile
|     ...
|     class ZipFile
|      |  Class with methods to open, read, write, close, list zip files.
|      |
|      |  z = ZipFile(file, mode="r", compression=ZIP_STORED)
|      |
|      |  file: Either the path to the file, or a file-like object.
|      |        If it is a path, the file will be opened and closed by ZipFile.
|      |  mode: The mode can be either read "r", write "w" or append "a".
|      |  compression: ZIP_STORED (no compression) or ZIP_DEFLATED (requires
|      ...
| Skip

More information about the Python-list mailing list