Skip to content

Instantly share code, notes, and snippets.

@munsiwoo
Last active February 11, 2018 08:10
Show Gist options
  • Save munsiwoo/5e8351ad72c1bc32e7fa2ee718e3e1d6 to your computer and use it in GitHub Desktop.
Save munsiwoo/5e8351ad72c1bc32e7fa2ee718e3e1d6 to your computer and use it in GitHub Desktop.
python zipfile lib (unzip example)
import zipfile
# made by munsiwoo
extractFile = "./archive.zip"
extractNum = 0
while True :
unzip = zipfile.ZipFile(extractFile)
if(unzip.namelist()[0][7:] == "zip") :
unzip.extractall("./extract/" + str(extractNum))
extractFile = "./extract/" + str(extractNum)
extractFile += "/" + unzip.namelist()[0]
print(extractFile)
extractNum += 1
else :
print("---------------------")
print("Path : " + extractFile)
print("---------------------")
break
unzip.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment