Re: calling obect method

2009-07-30 Thread Benjamin Kaplan
On Thu, Jul 30, 2009 at 3:04 PM, srinivasan srinivas < sri_anna...@yahoo.co.in> wrote: > Hi, > 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? > For ex > If object is x and string y has one of its method names. > x.value(y)()

Re: calling obect method

2009-07-30 Thread r
>>> import math >>> getattr(math, 'hypot')(3,4) 5.0 -- http://mail.python.org/mailman/listinfo/python-list

calling obect method

2009-07-30 Thread srinivasan srinivas
Hi, 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? For ex If object is x and string y has one of its method names. x.value(y)() ---. Is there a way to do this? Thanks, Srini See the Web's breaking stories, chosen by