Uwe Lauth wrote:
> kyle.tk wrote:
>
>>I want to make a function that will work like this:
>>
>>def updateField(object, fieldName, newValue):
>> object.fieldName = newValue
>
> This function already exists in python.
> It is called settattr.
Or rather setattr.
--
Robert Kern
[EMAIL PROTECT
kyle.tk wrote:
> I want to make a function that will work like this:
>
> def updateField(object, fieldName, newValue):
> object.fieldName = newValue
This function already exists in python.
It is called settattr.
Regards
Uwe
--
http://mail.python.org/mailman/listinfo/python-list
I want to make a function that will work like this:
def updateField(object, fieldName, newValue):
object.fieldName = newValue
fieldName could be anything, the list of objects fields will grow as my
project goes on and i want to reuse the same code without adding more
if statements to it