Fix Python – Get a filtered list of files in a directory

I am trying to get a list of files in a directory using Python, but I do not want a list of ALL the files.
What I essentially want is the ability to do something like the following but using Python and not executing ls.
ls 145592*.jpg

If there is no built-in method for this, I am currently thinking of writing a for loop to iterate through the res….

Fix Python – How to use glob() to find files recursively?

This is what I have:
glob(os.path.join(‘src’,’*.c’))

but I want to search the subfolders of src. Something like this would work:
glob(os.path.join(‘src’,’*.c’))
glob(os.path.join(‘src’,’*’,’*.c’))
glob(os.path.join(‘src’,’*’,’*’,’*.c’))
glob(os.path.join(‘src’,’*’,’*’,’*’,’*.c’))

But this is obviously limited and clunky.
….