Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Demonstrates how to use zipfile to list the files contained in a zip archive.
import zipfile
myZipFile = zipfile.ZipFile( "test.zip", "r" )
# List all files contained within the zip file
for fileName in myZipFile.namelist():
print fileName
print
# 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
You can’t perform that action at this time.