绘制ascii树。
asciitree的Python项目详细描述
asciitree
+-- sometimes
| +-- you
+-- just
| +-- want
| +-- to
| +-- draw
+-- trees
+-- in
+-- your
+-- terminal
fromasciitreeimportLeftAlignedfromcollectionsimportOrderedDictasODtree={'asciitree':OD([('sometimes',{'you':{}}),('just',{'want':OD([('to',{}),('draw',{}),])}),('trees',{}),('in',{'your':{'terminal':{}}})])}tr=LeftAligned()print(tr(tree))
阅读http://pythonhosted.org/asciitree上的文档