Paramaterized local variable name

Tim Cera timcera at
Sun Dec 30 09:34:52 EST 2001

Hans Nowak <wurmy at> wrote
> You probably want
>   start = getattr(data[key][i], local_name)
> Now you can set local_name to a string "name" or "rev"
> or whatever attribute of data[key][i] you want to
> access.

Works great!


Thanks also to Sean for the 'exec' based solution.

take care
Tim Cera

More information about the Python-list mailing list