An often-used concept in shell scripting is globbing. You can use this in python, as well:
import glob for textFile in glob.glob("*.txt"): # Do something with 'textFile'.