On Wed, Jul 22, 2009 at 10:29 PM, Ryniek90 <rynie...@gmail.com> wrote:

> Thanks for hint, but looks like i can't do what i want.


That's because

>
>         def _SetVar(self, attr, val):
>       self.attr = val


 doesn't work as you might think. However, I tried to replace it with:

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

and it gives me a syntax error!

  File "test.py", line 7, in _setVar
    eval('self.' + attr + '=\'' + val + '\'')
  File "<string>", line 1
    self.var='Mrra'
            ^
SyntaxError: invalid syntax

So, uh, I'm wondering if this is a bug. And also the solution to his
problem.

Good luck. Any ideas appreciated.

Ching-Yun "Xavier" Ho, Technical Artist

Contact Information
Mobile: (+61) 04 3335 4748
Skype ID: SpaXe85
Email: cont...@xavierho.com
Website: http://xavierho.com/
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to