Skip to content

When i create a Tree , its not maintaining the order which in i created the children when i invoke show method #170

Closed
@salman0149

Description

@salman0149

from treelib import Node, Tree
tree = Tree()
tree.create_node('Students', 'Students', parent=None)
Node(tag=Students, identifier=Students, data=None)
tree.create_node('Ben', 'Ben',parent='Students')
Node(tag=Ben, identifier=Ben, data=None)
tree.create_node('Annie', 'Annie',parent='Students')
Node(tag=Annie, identifier=Annie, data=None)
tree.show()
Students
├── Annie
└── Ben

As you see eventhough i created Ben Node first as child it is displaying Annie first, is there an argument in show() or in create_method() which i can pass to maintain the order when i call show method

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions