This commit is contained in:
Will McGugan 2021-01-09 17:03:58 +00:00
parent a6d81a3267
commit 0f88bef922
1 changed files with 2 additions and 2 deletions

View File

@ -13,13 +13,13 @@ The following code creates and prints a tree with a simple text label::
from rich import print from rich import print
tree = Tree("Rich Tree") tree = Tree("Rich Tree")
print(root) print(tree)
With only a single ``Tree`` instance this will output nothing more than the text "Rich Tree". Things get more interesting when we call :meth:`~rich.tree.Tree.add` to add more branches to the Tree. The following code adds two more branches:: With only a single ``Tree`` instance this will output nothing more than the text "Rich Tree". Things get more interesting when we call :meth:`~rich.tree.Tree.add` to add more branches to the Tree. The following code adds two more branches::
tree.add("foo") tree.add("foo")
tree.add("bar") tree.add("bar")
print(root) print(tree)
The tree will now have two branches connected to the original tree with guide lines. The tree will now have two branches connected to the original tree with guide lines.