I hope you guys are fine.
I want to manipulate data which is in any-tree(python library) node
I am storing my dictionary in my node and want to take values from node and manipulate it.
My code:
data={
"man":False,
"goat":False,
"lion":False,
"grass":False
}
udo = Node(data)
print (udo)
print (udo["man"])
Result:
Node("/{'man': False, 'goat': False, 'lion': False, 'grass': False}")
now if I will call object with index of Dictionary It generates an error. Error!
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-27-2d29abc19bbb> in <module>()
8 print (udo)
9
---> 10 print (udo["man"])
TypeError: 'Node' object is not subscriptable
I read python any-tree documentation but didn't find any help.