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. 28 s 28 pathlib.Path.rglob Use pathlib.Path.rglob from the the pathlib module, which was introduced in Python 3.5. from pathlib import Path for path in … Read more