python get object attribute code example
Example 1: python get object attribute by string
x = getattr(t, 'attr1')
setattr(t, 'attr1', 21)
Example 2: python get attributes of object
getattr(object, 'attribute_name')
x = getattr(t, 'attr1')
setattr(t, 'attr1', 21)
getattr(object, 'attribute_name')