# -*- coding: utf-8 -*-
# @Time : 2023/4/2 4:14
# @Author : yujin wang
# @Email : yujeen.wang@gmail.com
import os
import zipfile
dir_path = "C:/Users/19349/nltk_data"
for root, dirs, files in os.walk(dir_path):
for file in files:
if file.endswith(".zip"):
print(file)
file_path = os.path.join(root, file)
with zipfile.ZipFile(file_path, 'r') as zip_ref:
zip_ref.extractall(root)
print('unzip ok!')