Last active
February 11, 2018 08:10
-
-
Save munsiwoo/5e8351ad72c1bc32e7fa2ee718e3e1d6 to your computer and use it in GitHub Desktop.
python zipfile lib (unzip example)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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