i am looking for specific files in a directory with many subdirectories
is there a pythonic way to rewrite this? I want to avoid the first for loop if possible:
mytypes = [".txt", ".doc", ".docx"]
for ext in mytypes:
for filename in glob.iglob(directory+"/**/*/"+ext, recursive=True):
print(filename)
thank you if you can point me to right direction. This works fine but I want to optimize the code because the list of mytypes might get bigger and the directory is heavy. This is what I tried but I believe there is a better way...