1import zipfile
2with zipfile.ZipFile("file.zip","r") as zip_ref:
3 zip_ref.extractall("targetdir")
1
2import zipfile
3def un_zipFiles(path):
4 files=os.listdir(path)
5 for file in files:
6 if file.endswith('.zip'):
7 filePath=path+'/'+file
8 zip_file = zipfile.ZipFile(filePath)
9 for names in zip_file.namelist():
10 zip_file.extract(names,path)
11 zip_file.close()