I am looking to recursively search through a folder containing many sub-folders. Some sub-folders contain a specific folder that I want to loop through.
I am familiar with the glob.glob method to find specific files:
import glob, os
from os import listdir
from os.path import isfile, join
os.chdir(pathname) #change directory to path of choice
files = [f for f in glob.glob("filename.filetype") if isfile(join(idir, f))]
Some sub folders in a directory have a time stamp (YYYYMMDD) as their names all containing identical file names. Some of those sub folders contain folders within them with a name, let's call it "A". I'm hoping to create a code that will recursively search for the folder within called "A" within these "specific sub folders". Is there a way to use glob.glob to find these specific sub-folders within a directory?
I am aware of a similar question: How can I search sub-folders using glob.glob module in Python?
but this person seems to be looking for specific files, whereas I am looking for pathnames.