Saturday, November 10, 2012

Python how to get a list of files in a directory

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