Python遍历windows下所有目录

a=["c:\\","d:\\"]
import os
for i in a:
    for root,dirs,paths in os.walk(i):
        for pathfile in paths:
            print(os.path.join(root,pathfile))

猜你喜欢

转载自blog.csdn.net/qqaazzww1234/article/details/80728723
今日推荐