To this code we will add few more rows where some rows are child of parent row. The identification of parent and child is done by the values for parent option and the iid.
The child will have to iid of parent as option.
open=True/False
By default the child row can be displayed by using open=True. If this value is set to False then child will be in collapsed state, however it can be displayed by expanding the Tree ( + symbol ) in tree view and by double clicking in headers view.
The full code with parent - child in Treeview is here.
my_list=[]
for child in trv.get_children():
my_list.append(trv.item(child)["values"][1])
#print(trv.item(child)["values"])
#print(trv.item(child)["values"][1]) # for Name
print(my_list)