import zipfile
import os
import pandas as pd
import numpy as np
import glob
STRWORKINGDIR = r"FOLDER PATH"
# Loop to extract all the zip files
def un_zipFiles(path):
files=os.listdir(path)
for file in files:
if file.endswith('.zip'):
filePath=path+'/'+file
zip_file = zipfile.ZipFile(filePath)
for names in zip_file.namelist():
zip_file.extract(names,path)
print('Extracted file .. '+ names)
zip_file.close()
un_zipFiles(STRWORKINGDIR)
print('Extracted all the files')
Comments
Post a Comment