Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Can I print the data of a node when data is of type string? #231

Open
furiousarmadillo opened this issue Jul 12, 2024 · 0 comments

Comments

@furiousarmadillo
Copy link

furiousarmadillo commented Jul 12, 2024

I need a tree representing an eshop, the nodes being eshop categories
tag--> category name
identifier--> category id
data--> category link (type string)

Can I print the data of the nodes? (since there is no data_property(attribute) I am aware of that I can call on a string to get the value of it)

tree = treelib.Tree()
tree.create_node(tag="main", identifier=0, data="main-url")
tree.create_node(tag="category1", identifier=1, parent=0, data="category1-url")
tree.create_node(tag="category2", identifier=2, parent=0, data="category2-url")
print(tree.show(stdout=False, data_property=???))`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant