I'm processing a large amount of files using Python. Data related to each other through their file na开发者_如何学编程mes.
If I was to perform CMD command to perform this (in windoes) it would look something like:
DIR filePrefix_??.txt
And this would return all the file names I would need for that group.
Is there a similar function that I can use in Python?
Have a look at the glob module.
glob.glob("filePrefix_??.txt")
returns a list of matching file names.
精彩评论