I have a tree t which some of its nodes has an attribute 'a' I want to test if a given node has this attribute, what I did is
if not n.a:
print "no a "
but I'm getting an error treenode n has no attribute a
Any way to test it ?
I have a tree t which some of its nodes has an attribute 'a' I want to test if a given node has this attribute, what I did is
if not n.a:
print "no a "
but I'm getting an error treenode n has no attribute a
Any way to test it ?
You could just use the generic pythonic way
If "a" is registered as a regular feature in your ETE tree, you could also use the following approach:
which would print something like this: