开发者

Grabbing all files in a query using Python

开发者 https://www.devze.com 2023-01-26 21:25 出处:网络
I\'m processing a large amount of files using Python. Data related to each other through their file na开发者_如何学编程mes.

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

精彩评论

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

关注公众号