Hi guys, sorry for the off topic posting, but I know there are a
couple of python guys on the list, so could not resist asking here
Just a quick question.

For example I have

>>> class X
>>> ....pass

Then I do
>>> x = X()
>>> x.name = 'Nazim

Now my question is whether something like below is possible and how
>>> y = 'name'
>>> print x.y   #  How can x.y can be evaluated to x.name


PS: In PHP this can be done by a $x->$y. I sure there is some way in
Python also, just don't seem to remember/find it right now.


Thanks in advance.

Mir Nazim
Cell: +91 9469071855
Blog: http://saunzal.org
Company:http://www.ikraftsoft.com

-- 
ubuntu-in mailing list
ubuntu-in@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-in

Reply via email to