Well this is extremely OT, but someone on this list might be willing to help...
Does anyone know of a way to use a variable in place of a method name Python. Something like:
foo = 'method' bar.foo
whereby bar.foo gets substituted by bar.method
??
Jamie
Hallo, Jamie Bullock hat gesagt: // Jamie Bullock wrote:
Well this is extremely OT, but someone on this list might be willing to help...
Does anyone know of a way to use a variable in place of a method name Python. Something like:
foo = 'method' bar.foo
whereby bar.foo gets substituted by bar.method
pydoc getattr
See attached pyext patch, which uses this.
Ciao
Thanks Frank,
That's just the ticket..
Ciao!
On Mon, 24 Apr 2006 14:29:50 +0200 Frank Barknecht fbar@footils.org wrote:
Hallo, Jamie Bullock hat gesagt: // Jamie Bullock wrote:
Well this is extremely OT, but someone on this list might be willing to help...
Does anyone know of a way to use a variable in place of a method name Python. Something like:
foo = 'method' bar.foo
whereby bar.foo gets substituted by bar.method
pydoc getattr
See attached pyext patch, which uses this.
Ciao