I have a zip file which contains the following directory structure:
dir1\\dir2\\dir3a
dir1\\dir2\\dir3b
I\'m trying to unzip it and maintai
I know it may be a little late to say this but Jeff is right. It's as simple as:
import os
from zipfile import ZipFile as zip
def extractAll(zipName):
z = zip(zipName)
for f in z.namelist():
if f.endswith('/'):
os.makedirs(f)
else:
z.extract(f)
if __name__ == '__main__':
zipList = ['one.zip', 'two.zip', 'three.zip']
for zip in zipList:
extractAll(zipName)