fork download
'''    
    I want a function which returns:
    dict("file1.txt": list(),
         "file2.txt": list(),
         "file3.txt": list(),
         "file4.txt": list())
    
    For input: 
        file.zip:
            outer\
            outer\inner1.zip:
                    file1.txt
                    file2.txt
            outer\inner2.zip:
                    file3.txt
                    file4.txt
'''

from zipfile import ZipFile, is_zipfile

def unarchive_all(input_zip):
    a=[]
    z = ZipFile(input_zip);
    for member in z.namelist():
        if is_zipfile(member):
            sub_z = ZipFile(file=z.open(member))
            for filename in sub_z.namelist():
                a.append(filename) # just for testing
    return a

if __name__ == "__main__":
    print unarchive_all('file.zip')
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout

Standard output is empty