I'm using GDAL to calculate NDVI mean and max and to find other information about .tif Landsat images acquired from Earth Explorer. I stacked the bands into a single .tif image and have a working python script to find everything I want to know about the image, however I have many .tif files and I don't want to run the script individually for each file, and I want to make my script automatically run the code over every .tif file I have in the same folder.
The beginning of my script, and how I am accessing the single .tif file looks like this:
from __future__ import print_function
from osgeo import gdal
print("GDAL's version is: " + gdal.__version__)
print (gdal)
print(gdal.GDT_Byte)
dataset = gdal.Open('/Path/To/Folder/Containing/.tif', gdal.GA_ReadOnly)
How would I get Python to run the script over every file in this folder automatically?