Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

Mass UnZipper - Python Code Bank


Mass UnZipper
I wrote this about a year ago to unzip thousands of ROMs a friend gave me. They where all individual zipped and I got fed up unzipping them one by on. The code looks kinda sloppy, but it works.
                import zipfile, os

print """=-=-=-=-=-=-=--=MASS_ZIP_EXTRACTION=-=-=-=-=-=-=--=
=-=-=-=-=-=-=-=-BY: Tech B.    =-=-=-=-=-=-=-=-=-=-="""
print """


"""

d = raw_input("""Path to Directory containing the Zip's to be extracted
example: C:\\Users\\TechB\\Desktop\\Zips
:""")

zList = os.listdir(d)
badList = []
gnt = 0
bnt = 0
allz = 0
for z in zList:
  try:
    di = d
    di += '\\' + z    
    if zipfile.is_zipfile(di) == True:
        x = zipfile.ZipFile(di)
        x.extractall(raw_input("""Path to where you want the zips to be extracted to
example: C:\\Users\\owner\\Extraction_Folder
:"""))
        gnt += 1
        allz += 1
        print "extracted: ", z, gnt
        
    else:
        bnt += 1
        allz += 1
        badList.append(z)
        print "failed: ", z, bnt
  except:
      allz += 1
      badList.append(z)
      print 'Error: ', z


print "=-=-=-=-=-=-==-=-=-=-=-=-="
print "Total files: %d" % allz
print "=-=-=-=-=-=-=-==-=-=-=-=-="
print "Failed files:"
for i in badList:
    print i


    
    
        
        
    

            
Comments
Sorry but there are no comments to display