#/usr/bin/python
import os def travelTree(currentPath, count=0):
if not os.path.exists(currentPath):
print "no current Path"
return
if os.path.isfile(currentPath):
fileName = os.path.basename(currentPath)
print " "*count + "|_ "+fileName
elif os.path.isdir(currentPath):
#print currentPath
print " "*count + "|_ "+currentPath
pathList = os.listdir(currentPath)
for eachPath in pathList:
travelTree(currentPath + '/' + eachPath, count + 1)
else :
print "\n"
return travelTree('/Users/liyi/Desktop')
#travelTree('/Users/liyi/Desktop/test.sh', 1)

最新文章

  1. HeapSort 堆排序 基于伪代码实现
  2. ANT build.xml文件详解
  3. Myeclipse加载maven
  4. lvs简单配置
  5. Spket在Eclipse/MyEclipse下的安装和配置支持Ext(图文教程)
  6. MVC 自定义AuthorizeAttribute实现权限管理
  7. Sprite Kit编程指南(1)-深入Sprite Kit
  8. Python之路:迭代器和yield生成器
  9. TS流文件
  10. Thinking in scala (7)---- f(n)=f(n-1)+2f(n-2)+3f(n-3)
  11. [偏序关系与CDQ分治]【学习笔记】
  12. [dev][crypto][strongswan] 有关strongswan的forward policy的源码分析
  13. WinForm 绑定到嵌套对象上的属性
  14. ubuntu 下安装mulval
  15. Diverse Garland CodeForces - 1108D (贪心+暴力枚举)
  16. BZOJ3456 城市规划 【多项式求ln】
  17. VMware安装windows10系统
  18. Docker镜像、容器剖析
  19. TPL DataFlow初探(一)
  20. SqlServer基础语法(二)

热门文章

  1. github代码上传下载慢问题
  2. GATK的硬过滤
  3. 20144303《Java程序设计》第10周学习总结
  4. Linux禁止普通用户使用crontab命令
  5. 【网络结构】GoogLeNet inception-v1:Going deeper with convolutions论文笔记
  6. Asp.Net MVC 缓存设计
  7. consul 小結
  8. 你曾后悔进入 IT 行业吗?为什么?(转自知乎)--一生不悔入IT
  9. Excel_To_DataTable
  10. C#多线程3种创建Thread、Delegate.BeginInvoke、线程池