feval similar to Matlab

Dan Bishop danb_83 at yahoo.com
Fri Mar 26 03:10:29 EST 2004


"Nobody" <user_77 at hotmail.com> wrote in message news:<eiN8c.344132$Po1.301096 at twister.tampabay.rr.com>...
> I have to (re)write a matlab program in a language of my choice (it's for a
> numerical analysis class) and it uses feval.  I was wondering if there's any
> python module that works similarly (to feval).  It would save me a lot of
> hassle. :)

>>> def feval(funcName, *args):
...    return eval(funcName)(*args)
...
>>> from math import *
>>> feval('log', 256, 2)
8.0



More information about the Python-list mailing list