Skip to content

Instantly share code, notes, and snippets.

@catwell
Created March 19, 2012 10:58
Show Gist options
  • Save catwell/2107541 to your computer and use it in GitHub Desktop.
Save catwell/2107541 to your computer and use it in GitHub Desktop.
List parts of Zip file (Python)
from zipfile import ZipFile,ZIP_DEFLATED,ZIP_STORED
from sys import argv
with ZipFile(argv[1],"r") as x:
for y in x.infolist():
if y.compress_type == ZIP_DEFLATED:
print y.filename + " deflated"
elif y.compress_type == ZIP_STORED:
print y.filename + " stored"
else:
print y.filename + " WTF"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment