Created
June 5, 2015 03:35
-
-
Save stevenswafford/4e78f6bee40ab31b35c8 to your computer and use it in GitHub Desktop.
Demonstrates how to use zipfile to list the files contained in a zip archive.
This file contains hidden or 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
import zipfile | |
myZipFile = zipfile.ZipFile( "test.zip", "r" ) | |
# List all files contained within the zip file | |
for fileName in myZipFile.namelist(): | |
print fileName | |
# List file information | |
for info in myZipFile.infolist(): | |
print info.filename, info.date_time, info.file_size | |
raw_input( '\n\nPress Enter to exit...' ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment