On Wed, Jul 22, 2009 at 10:29 PM, Ryniek90 <span dir="ltr"><<a href="mailto:ryniek90@gmail.com">ryniek90@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks for hint, but looks like i can't do what i want.</blockquote><div><br>That's because<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
def _SetVar(self, attr, val):<br>
self.attr = val</blockquote><div><br> doesn't work as you might think. However, I tried to replace it with:<br><br><div style="margin-left: 40px;">val('self.' + attr + '=\'' + val + '\'')<br>
</div><br>and it gives me a syntax error!<br><br><div style="margin-left: 40px;"> File "test.py", line 7, in _setVar<br> eval('self.' + attr + '=\'' + val + '\'')<br> File "<string>", line 1<br>
self.var='Mrra'<br> ^<br>SyntaxError: invalid syntax<br></div><br>So, uh, I'm wondering if this is a bug. And also the solution to his problem.<br><br>Good luck. Any ideas appreciated.<br><br>Ching-Yun "Xavier" Ho, Technical Artist<br>
<br>Contact Information<br>Mobile: (+61) 04 3335 4748<br>Skype ID: SpaXe85<br>Email: <a href="mailto:contact@xavierho.com">contact@xavierho.com</a><br>Website: <a href="http://xavierho.com/">http://xavierho.com/</a><br></div>
</div>