List files in the zip file : File Zip « File « Python






List files in the zip file

List files in the zip file

import zipfile
zz = zipfile.ZipFile('z.zip')
zz.printdir()
for name in zz.namelist():
    print '%s: %r' % (name, zz.read(name))
zz.close()

           
       








Related examples in the same category

1.Zip file
2.Loop through header information in a ZIP file
3.Multi-threading: zip file