'Use glob to check every file in every director

So I have a problem with glob that it returns an empty list [] for any search I do. I assume it is because I am in the wrong directory. So How would I use glob to search all the files under records. (see image) I am trying to find the attendance records for the desired date. (They pass in date, it searches, and returns the data in it (using pd))

What I have tried:

gen = glob.iglob(date)
for x in gen:
     print(x)

enter image description here



Solution 1:[1]

for f in glob.glob(f'/{dir}/**/{date}', recursive=True):
          print(f)
          pd.read_csv(file)

This ended up working out for me. :D

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Thornily