查找当前路径下,所有的.xlsx文件

1
locate .xlsx

python 代码实现操作

1
2
3
4
5
6
7
8
import os
path = "..."
musics = []
for dirpath, dirnames, filenames in os.walk(path):
    for filename in filenames:
        if os.path.splitext(filename)[1] == ".mp3":
            musics.append(os.path.join(dirpath, filename))
musics # 每个MP3的路径

Reference

打赏

微信 微信 支付宝 支付宝
万分感谢