auto read multiple files
Pete Shinners
shredwheat at attbi.com
Thu May 9 11:16:48 EDT 2002
Rad wrote:
> Hi,
>
> I have about 2500 text files to read (and manipulate) from apx. 625
> directories (i.e. 4 files per directory) eg:
use the glob module, it should be a pefect fit for you. it does
unixy-wildcard matching on filenames and paths.
import glob
filenames = glob.glob(r'C:\Python22\data\ProjectName\*\FileName?.*')
for filename in filenames:
processfile(filename)
it seems very strange to me that you care keeping these thousands of
data files inside the C:\Python22 directory?
More information about the Python-list
mailing list