asciitree绘制ASCII树,如下所示:
root
+--sub1
+--sub2
| +--sub2sub1
+--sub3
+--sub3sub1
| +--sub3sub1sub1
+--sub3sub2
有没有提示如何用python打印“反转”树?这里有一个例子:
^{pr2}$asciitree使用以下节点结构:
class Node(object):
def __init__(self, name, children):
self.name = name
self.children = children
您只需反转
asciitree
的输出:演示:
^{pr2}$相关问题 更多 >
编程相关推荐