is there an equivalent of javascript's this["myMethod"] for the currently running script?

markturansky at markturansky at
Wed Jul 6 05:25:47 CEST 2005

I'd like to dynamically find and invoke a method in a Python CGI.

In javascript, the running script is 'this' (Python's 'self'), except
that 'self' is not defined.

I want to do this:

var m = this["MethodName"];  //where the method name is passed via an
http variable
m();  //this invokes a method in javascript

How do I do the same in python?

self["MethodName"] fails...

More information about the Python-list mailing list