Search files iteratively in Python Nov 7, 2020 Here’s the table of contents: Snippet for searching files with certain ending Snippet for searching files with certain ending import os rootdir = '/home/username/' for subdir, dirs, files in os.walk(rootdir): for file in files: if(".png" in file): print(os.path.join(subdir, file)) See!