You can use the object's internal dictionary (assuming "obj" is an instance of some object):
Code:
for o in obj.__dict__:
obj.__dict__[o] = "some new value"
If you have a source, like another dictionary that contains the same keys as the object's properties:
Code:
sauce = {"one": "some", "two": "value", "three": "here" }
for k, v in sauce.items():
# Do nothing if k is not a property of obj.
if obj.__dict__.get(k):
obj.__dict__[k] = v
More to address your problem:
Code:
for key, value in obj.__dict__.items():
obj.__dict__[k] = value.replace("o", "replacement text")