getattr does not work on a running script (afaik) because 'self' is
undefined. The poster above got it right using 'locals()'
--
http://mail.python.org/mailman/listinfo/python-list
'self' is not defined in this circumstance. The poster above (using
'locals()') has it right.
--
http://mail.python.org/mailman/listinfo/python-list
Yes, that is exactly what I was looking for. Thank you. I will read
more about 'locals()', but a quick test proved you right.
--
http://mail.python.org/mailman/listinfo/python-list
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