I try to unzip 150 zip files. All the zip files as different names, and they all spread in one big folder that divided to a lot of sub folders and sub sub folders.i want to extract each archive to separate folder with the same name as the original zip file name and also in the same place as the original zip file . my code is:
import zipfile
import os,os.path,sys
pattern = '*.zip'
folder = r"C:Projectlayers"
files_process = []
for root,dirs,files in os.walk(r"C:Projectlayers"):
for filenames in files:
if filenames == pattern:
files_process.append(os.path.join(root, filenames))
zip.extract()
After i run the code nothing happened.
Thanks in advance for any help on this.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…