feat: extracting with progressive bar

This commit is contained in:
monoid 2022-02-23 19:21:45 +09:00
parent 99a88c6da5
commit 3a5ff50fc4

View File

@ -18,8 +18,9 @@ def downloadNsmc(filename = "nsmc.zip"):
t.close() t.close()
if __name__ == "__main__": if __name__ == "__main__":
os.makedirs("nsmc") os.makedirs("nsmc", exist_ok=True)
if not os.path.exists("nsmc.zip"): if not os.path.exists("nsmc.zip"):
downloadNsmc() downloadNsmc()
with zipfile.ZipFile("nsmc.zip") as nsmc: with zipfile.ZipFile("nsmc.zip") as nsmc:
nsmc.extractall("nsmc") for member in tqdm.tqdm(nsmc.infolist(), desc="Extracting", unit="files"):
nsmc.extract(member,"nsmc")