Wolfram Kraus wrote:
Felix Hebeler wrote:
I need to call an object attribute:
value = object.attrName[0]
Use getattr:
value = getattr(object, attrName)[0]
HTH,
Wolfram
Thanks so much!
Had I known earlier.
Looks so easy...
Now, why did I not find this in the online tutorial, the reference
Hi all,
I am doing some Python scripting for a while, but I'm not too deep into
it yet. So I have a problem I can't solve.
I need to call an object attribute:
value = object.attrName[0]
the problem is, that the attribute name can only be specified at runtime.
So what I have is something like
>>>