python">from os.path import basename, isdir from os import listdir def traverse(path, depth=0): print depth* '| ' + '|_', basename(path) if(isdir(path)): for item in listdir(path): traverse(path+'/'+item, depth+1) if __name__ == '__main__': traverse('./')
python遍历目录树代码
最后更新 2018-05-17 08:00 星期四 所属:
Python教程 浏览:404