Created
June 5, 2015 03:35
Star
You must be signed in to star a gist
Demonstrates how to use zipfile to list the files contained in a zip archive.
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
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