python get attribute of class code example
Example 1: python class get attribute by name
>>> class c:
pass
o = c()
>>> setattr(o, "foo", "bar")
>>> o.foo
'bar'
>>> getattr(o, "foo")
'bar'
Example 2: python get attributes of object
getattr(object, 'attribute_name')