遍历某文件夹所有文件并输出其文件绝对路径

import os

def findAllFile(base):
for root, ds, fs in os.walk(base):
for f in fs:
fullname = os.path.join(root, f)
yield fullname

def main():
base = 'Y:\\work\\报告'
for i in findAllFile(base):
print(i)

if __name__ == '__main__':
main()

上一篇:GooseFS 统一命名空间 | 加速存储业务访问


下一篇:Node.js初识