# 目录树
import os
def travelTree(currentPath, count):
if not os.path.exists(currentPath):
return
if os.path.isfile(currentPath):
fileName = os.path.basename(currentPath)
print '\t' * count + '├── ' + fileName
elif os.path.isdir(currentPath):
print '\t' * count + '├── ' + currentPath
pathList = os.listdir(currentPath)
for eachPath in pathList:
travelTree(currentPath + '/' + eachPath, count + 1)
travelTree('E:\updata', 1)
用户登录
还没有账号?立即注册
用户注册
投稿取消
| 文章分类: |
|
还能输入300字
上传中....
哎呦卧草