(Jan-31-2018, 01:33 PM)Oliver Wrote: I found code online that will do 2 levels, but I'm having issues making that same code recursive for nested zip files beyond 2 levels.Both os.walk() and glob(recursive=True) do a recursive search of whole file tree and fast after PEP 471
Example:
import os path = r'E:\1py_div\click' for root, dirs, files in os.walk(path): for file in files: if file.endswith(('.zip', '.also_me')): print(file) # To get absolute path that may be needed in a function call # print(os.path.join(root, file)) # Eg ProcessZipFile(os.path.join(root, file))