import os
path = r'C:\Users\admin\Desktop\b'
files = os.listdir(path)
files.sort(key=lambda x: int(x.split('.')[0]))
for name in files:
full_path = os.path.join(path, name)
print(full_path)
按文件夹内的文件编号排序依次读取文件 python
最新推荐文章于 2023-03-07 00:32:53 发布