python生成文件目录树代码,python生成树代码,code:import
python生成文件目录树代码,python生成树代码,code:import
code:
import osdef tree(d, n = 0): for i in os.listdir(d): p = os.path.join(d,i) print n*'| '+'|__'+os.path.basename(p) if os.path.isdir(p): tree(p, n+1)tree('./')
不过真心不如linux下的tree命令好看!
|__solarizeddark-style| |__solarizeddark_style.html|__solarizedlight-style| |__solarizedlight_style.html|__index.html|__static| |__solarizedlight-code-style.css| |__solarizeddark-code-style.css| |__style.css| |__.style.css.swp| |__github-code-style.css| |__noise.png|__github-style| |__github_style.html
相关内容
- python实现Memento模式,python实现memento,下面的例子通过
- Python生成字母,数字,特殊符号组成的随机密码,pyt
- Tkinter的ToolTip控件,tkintertooltip,Tkinter的Tool
- python中的filter方法,pythonfilter方法,filter函数:fil
- python自动连接ssh的代码,pythonssh代码,python自动连接ss
- Python处理命令行参数示例代码,python示例代码,下面代码
- Python实现简单的web server,pythonwebserver,这是Python实现的
- Python计算程序运行时间,python计算程序运行,使用time模
- python计算圆周率pi,python圆周率pi,from sys imp
- Python通过深拷贝实现从实例继承,python实例,Take an ins
评论关闭