Displaying a tree in ASCII

后端 未结 2 1347
萌比男神i
萌比男神i 2021-01-05 06:12

As a time-pass activity, I decided to implement a Tree(like) structure in python.
I implemented a Node class (which alone serves the purpose here) like so:<

2条回答
  •  南笙
    南笙 (楼主)
    2021-01-05 06:43

    I'd like to suggest to take a look at ETE module http://ete.cgenomics.org which implements the functionality you describe here and much more.

    At the same time, I'd like to provide this entry Pretty Print output in a sideways tree format in console window where a similar question has been asked before. As you can see in such discussion, the _asciiArt function from ETE provides what, I think, you are looking for.

    I hope this helps,

提交回复
热议问题