Pages

Tuesday, May 28, 2013

Import List of Filenames from a Directory into Python

The python glob module is useful for importing a list of all files of a desired type from a UNIX directory.  For example, if I wanted to get a list of all .txt files in my usr/home/projects directory, I would use the following code in python.

No comments:

Post a Comment