Simon Mullis wrote:
> def main():
>     stats_obj = Statistic()
>     name = re.sub("[^A-Za-z]", "", sys.argv[0])
>     method = getattr(stats_obj, name, None)
>     if callable(method):
>         stats_obj.name()              #  <------------HERE
>     else:
>         print "nope, not sure what you're after...."
> -----------
> 
> However, as I'm sure you've all noticed already, there is no method
> called "name". I would really prefer to get a nudge in the right
> direction before I start evaling variables and so on.

At the point you marked "HERE", you've already found the method, and you
have determined that it is callable. You just need to call it. Like
this: method().

HTH,

--
Carsten Haese
http://informixdb.sourceforge.net

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to