开发者

Grabbing all files in a query using Python

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜