python 目录遍历

2017-9-2 流沙 python

#coding:utf8

import os
for muluName,zimuluName,fileName in os.walk("H:\\LK"):
    for zimulu in zimuluName:
        print "目录:"+muluName+" 中的子目录:"+zimulu
    for file in fileName:
        print "目录:"+muluName+" 中的文件 :"+file

print ''

发表评论:

Powered by 流沙团

备案号:鄂ICP备15017378号-1