Get parameter by name

Oleg Broytmann phd at phd.russ.ru
Sat Nov 6 16:32:30 CET 1999


On Sat, 6 Nov 1999, Thomas A. Bryan wrote:
> I'm not sure whether I understand the question.  Is this what you're 
> trying to figure out?
> 
> >>> ka = 1 
> >>> x = 'ka'
> >>> eval(x)
> 1
> >>> y = eval(x)
> >>> y
> 1
> 
> If not, please repost.

   Yes, but it is better to use locals() or vars() function for this...

Oleg.
---- 
    Oleg Broytmann      Foundation for Effective Policies      phd at phd.russ.ru
           Programmers don't die, they just GOSUB without RETURN.





More information about the Python-list mailing list