unziping a file in python..

Steven D'Aprano steven at REMOVE.THIS.cybersource.com.au
Mon Mar 2 08:24:53 CET 2009

On Mon, 02 Mar 2009 01:00:54 -0500, David Lyon wrote:

> It might seem a simple question.. but how does one programmaticaly unzip
> a file in python?

A quick and dirty solution would be something like this:

zf = zipfile.ZipFile('Archive.zip')
for name in zf.namelist():
    open(name, 'w').write(zf.read(name))


More information about the Python-list mailing list