Extracting Zip Files
mfranklin1 at mfranklin.is-a-geek.org
Tue Sep 28 23:21:47 CEST 2004
Greg Lindstrom wrote:
> I've been zipping up files for months with zipfile, but today I was asked to
> extract the contents of a zip file and was sure there would be an "extract"
> method...but there's not one that I can find! Am I just missing something??
> I found a module, unzip.py, on Parnassus, but it doesn't work. Does anyone
> have a way for me to extract files? Thanks!
> Greg Lindstrom (501) 975-4859
> NovaSys Health greg.lindstrom at novasyshealth.com
> "We are the music makers, and we are the dreamers of dreams" W.W.
$ pydoc zipfile
| Return a list of file names in the archive.
| Print a table of contents for the zip file.
| read(self, name)
| Return file bytes (as a string) for name.
For example [untested]:-
zfile = zipfile.ZipFile("SomeZipFile.zip")
for name in zfile.namelist():
localFile = open(name, "wb")
More information about the Python-list