From 3a5ff50fc4757f912452e47cb120d69ec7e501cf Mon Sep 17 00:00:00 2001 From: monoid Date: Wed, 23 Feb 2022 19:21:45 +0900 Subject: [PATCH] feat: extracting with progressive bar --- download.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/download.py b/download.py index 747b6bd..d9a2d56 100644 --- a/download.py +++ b/download.py @@ -18,8 +18,9 @@ def downloadNsmc(filename = "nsmc.zip"): t.close() if __name__ == "__main__": - os.makedirs("nsmc") + os.makedirs("nsmc", exist_ok=True) if not os.path.exists("nsmc.zip"): downloadNsmc() with zipfile.ZipFile("nsmc.zip") as nsmc: - nsmc.extractall("nsmc") \ No newline at end of file + for member in tqdm.tqdm(nsmc.infolist(), desc="Extracting", unit="files"): + nsmc.extract(member,"nsmc") \ No newline at end of file