Apr-22-2024, 06:16 PM
Hello,
I need to find all the files located under a given directory, including all the sub-directories it may contain.
Is this a/the right way to do it?
I need to find all the files located under a given directory, including all the sub-directories it may contain.
Is this a/the right way to do it?
import os import glob for filename in glob.iglob(r".\parent" '**/**', recursive=True): #ignore sub-directories, just grab files if not os.path.isdir(filename): print(filename)Thank you.