Get parameter by name

Thomas A. Bryan tbryan at
Sat Nov 6 05:06:16 EST 1999

Oleg Broytmann wrote:

> and I have a list of strings "a1, td, ka". How can I get the value of
> corresponding args? E.g., if I have
>    x = "ka"
> how can I get the value of parameter, the name of which is in x ("ka", in
> this case)?

I'm not sure whether I understand the question.  Is this what you're 
trying to figure out?

>>> ka = 1 
>>> x = 'ka'
>>> eval(x)
>>> y = eval(x)
>>> y

If not, please repost.


More information about the Python-list mailing list