How do I do this? (eval() on the left hand side)

Caleb Hattingh caleb1 at telkomsa.net
Wed Dec 8 05:02:18 CET 2004


Hi It's me

>
>     a = 3
>     y = "a"
>     print eval(y)
>

To get 'a' to be 4 here, you would say

	a = 4

I am not sure why you would want to do otherwise?  Perhaps you could  
sketch out a little more about what you are trying to do?  That would help  
a lot.  Are you aiming for something like pointer emulation with simple  
datatypes?

Thanks
Caleb



More information about the Python-list mailing list