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

markturansky at gmail.com markturansky at gmail.com
Tue Jul 5 23:25:47 EDT 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