import os
import zipfile
PATH = 'path'
def extract(zipFile, dst):
with zipfile.ZipFile(zipFile) as z:
z.extractall(dst)
def func(path):
# ///// point 1 /////
for pathname, dirnames, filenames in os.walk(path):
for filename in filenames:
if filename.endswith('.zip'):
if not os.path.exists(pathname + '/' + os.path.splitext(filename[0]):
zipFile = pathname + '/' + filename
dst = pathname + '/' + os.path.splitext(filename)[0]
extract(zipFile, dst)
# ///// point 2 /////
func(dst)
def main():
func(PATH)
main()