nils.lastein at gmail.com
Fri Oct 19 13:34:39 CEST 2007
On Oct 19, 12:39 pm, lukasz.... at gmail.com wrote:
> Is there any way (other then eval) to invoke a method by passing
> method name in a string.
> It's very simple in php:
> $oFoo = new Foo();
> $dynamiMethod = "bar";
> Unfortunately I can't find a good solution to do the same thing in
> python. Does it have some build-in function to do it?
> Kind Regards,
Use apply(): http://docs.python.org/lib/non-essential-built-in-funcs.html
More information about the Python-list