Changing the private variables content

Xavier Ho contact at xavierho.com
Wed Jul 22 15:06:22 CEST 2009


Got it:

exec('self.' + attr + '=\'' + val + '\'')

That worked. I think it'll do what you want now ;)

Ching-Yun "Xavier" Ho, Technical Artist

Contact Information
Mobile: (+61) 04 3335 4748
Skype ID: SpaXe85
Email: contact at xavierho.com
Website: http://xavierho.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090722/12f34301/attachment.html>


More information about the Python-list mailing list