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

2005-07-06 Thread markturansky
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

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

2005-07-06 Thread markturansky
'self' is not defined in this circumstance. The poster above (using 'locals()') has it right. -- http://mail.python.org/mailman/listinfo/python-list

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

2005-07-06 Thread markturansky
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

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

2005-07-05 Thread markturansky
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