`os.walk()` is a Python function which serves to walk a directory tree.
With os.walk()
you can walk a directory tree and get, for each of the subdirectories, a list of file names.
A simple example goes like
import os
for root, dirnames, filenames in os.walk('.'):
for filename in filenames:
print os.join(root, filename)