tags:

views:

26

answers:

2

Possible Duplicate:
Unziping files in python

How do I extract a zip file with Python's ZipFile module? An example script would be awesome!

+1  A: 
import zipfile
archive = zipfile.ZipFile(<path-to-file>)
archive.extractall()

See the docs.

katrielalex
A: 
import zipfile

dest_dir = 'C://'
zf_name = 'C://my_zip.zip'
pwd = 'my_zip_password'

with zipfile.Zipfile(zf_name, 'r') as z:
    z.exctractall(dest_dir, pwd=pwd)
Steven Rumbalski