Convert the contents of a string into name of variable

3KWA eugene at boardkulture.com
Thu Mar 24 16:49:30 EST 2005


Erwan VITIERE wrote:
> Because i don't want to use this syntax because it is too long, I
want a
> direct access :
>
> Not :
> DicoUser['TOTO'].DicoTable.['MY_TABLE'].DicoLabel.['MY_LABEL']  =
"for
> exemple"
>
> Finally, i want to use :
> TOTO.MY_TABLE.MY_LABEL = "for exemple"

setattr might be what you are looking for




More information about the Python-list mailing list