br4nchPython 的数据结构树生成器
br4nch 是 Python 的数据结构树生成器。
以下是 br4nch 基础知识的示例:
>>> br4nch.add.branch(branch="Streaming", header="Movies & Series") >>> br4nch.add.layer(branch="Streaming", layer=["Netflix", "Prime Video"], position="0") >>> br4nch.add.layer(branch="Streaming", layer=["Movies", "Series"], position="*") >>> br4nch.add.layer(branch="Streaming", layer="Interstellar", position="1.1") >>> br4nch.add.layer(branch="Streaming", layer=["Squid Game", "The Crown"], position="1.2") >>> br4nch.add.layer(branch="Streaming", layer=["Tenet", "Parasite"], position="2.1") >>> br4nch.add.layer(branch="Streaming", layer="The Walking Dead", position="2.2") >>> br4nch.display.branch(branch="Streaming") Movies & Series ┣━ Netflix ┃ ┣━ Movies ┃ ┃ ┗━ Interstellar ┃ ┗━ Series ┃ ┣━ Squid Game ┃ ┗━ The Crown ┗━ Prime Video ┣━ Movies ┃ ┣━ Tenet ┃ ┗━ Parasite ┗━ Series ┗━ The Walking Dead
有关更多示例,可参阅文档。
评论