import glob a = glob.glob("*.html") b = glob.glob("image[0-5]*.gif")
import fnmatch if fnmatch(filename,"*.html"): ...