tree-format:用于在控制台上打印树的Python库

时间:2021-05-27 21:18:20
【文件属性】:
文件名称:tree-format:用于在控制台上打印树的Python库
文件大小:11KB
文件格式:ZIP
更新时间:2021-05-27 21:18:20
Python Python库可生成格式良好的树,例如UNIX tree命令。 例子 产生这样的输出: foo ├── bar │ ├── a │ └── b ├── baz └── qux └── c⏎ d 使用这样的代码: from operator import itemgetter from tree_format import format_tree tree = ( 'foo' , [ ( 'bar' , [ ( 'a' , []), ( 'b' , []), ]), ( 'baz' , []), ( 'qux' , [ ( 'c \n d' , []), ]), ], ) print f
【文件预览】:
tree-format-main
----MANIFEST.in(17B)
----.travis.yml(662B)
----tox.ini(444B)
----LICENSE(11KB)
----tree_format()
--------tests()
--------_text.py(4KB)
--------__init__.py(709B)
----requirements.txt(10B)
----setup.py(2KB)
----README.md(813B)

网友评论