python set attribut by string name

setattr(some_object, 'some_attribute', 42)
Arno Deceuninck