Python has really nice utilities for getting a directory listing inside a program!
I used os.listdir, but there are many other methods. Some are not available in python 2.5.
Source:
http://stackoverflow.com/questions/2225564/python-get-a-filtered-list-of-files-in-directory