Can i get methods dynamically from a pythonscript? getattr doesn't seem to work. I guess external methods would work, but can this be done? ##parameters=method=None ## def a(): return 'Hello' if method is not None: return getattr ( script, method )()
Hello Drew. As far as I know what you are trying to do does not work. Instead, define each method as a separate python script. Troy drew nichols wrote:
Can i get methods dynamically from a pythonscript? getattr doesn't seem to work.
I guess external methods would work, but can this be done?
##parameters=method=None ## def a(): return 'Hello'
if method is not None: return getattr ( script, method )()
drew nichols wrote at 2004-3-25 20:25 +1000:
Can i get methods dynamically from a pythonscript? getattr doesn't seem to work.
I guess external methods would work, but can this be done?
##parameters=method=None ## def a(): return 'Hello'
if method is not None: return getattr ( script, method )()
I should work... What happens? Important note: whenever you report problems "doen't seem to work" is not enough information. Most problems result in an exception. In this case, we need "Error type", "Error value" and "traceback" together with an informal description of the problem. -- Dieter
participants (3)
-
Dieter Maurer -
drew nichols -
Troy Farrell