Created
March 19, 2012 10:58
-
-
Save catwell/2107541 to your computer and use it in GitHub Desktop.
List parts of Zip file (Python)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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