I am fairly new to Python and I am trying to figure out the most efficient way to count the number of .TIF files in a particular sub-directory.
Doing some searching,
For this particular use case, if you don't want to recursively search in the subdirectory, you can use os.listdir:
os.listdir
len([f for f in os.listdir(myPath) if f.endswith('.tif') and os.path.isfile(os.path.join(myPath, f))])