I have a directory logfiles. I want to process each file inside this directory using a Python script.
for file in directory: # do something
You could try glob:
glob
import glob for file in glob.glob('log-*-*.txt'): # Etc.
But glob doesn't work recursively (as far as I know), so if your logs are in folders inside of that directory, you'd be better off looking at what Ignacio Vazquez-Abrams posted.