<br><br><div class="gmail_quote">On Thu, Jul 30, 2009 at 3:04 PM, srinivasan srinivas <span dir="ltr"><<a href="mailto:sri_annauni@yahoo.co.in">sri_annauni@yahoo.co.in</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
I would like to know if i have an object and one of its methods as a string. How to call the method using this string?<br>
For ex<br>
If object is x and string y has one of its method names.<br>
x.value(y)() ---. Is there a way to do this?<br>
<br>
Thanks,<br>
Srini</blockquote><div><br><br>getattr(x,y)() <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>
<br>
<br>
      See the Web's breaking stories, chosen by people like you. Check out Yahoo! Buzz. <a href="http://in.buzz.yahoo.com/" target="_blank">http://in.buzz.yahoo.com/</a><br>
<font color="#888888">--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></blockquote></div><br>