Here is a way to unzip files in Python. If you have a zip containing multiple files, you can unzip it like this:
import zipfilefh = open('foo.zip', 'rb')z = zipfile.ZipFile(fh)for name in z.namelist(): outfile = open(name, 'wb') outfile.write(z.read(name)) outfile.close()fh.close()
Copyright © 2006-2008 Corey Goldberg
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.