python set attribut by string name
setattr(some_object, 'some_attribute', 42)
Arno Deceuninck
setattr(some_object, 'some_attribute', 42)