feval similar to Matlab

Nobody user_77 at hotmail.com
Mon Mar 29 11:50:25 EST 2004


On Fri, 26 Mar 2004 00:10:29 -0800, Dan Bishop wrote:

> "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


Thank you Dan


Wr




More information about the Python-list mailing list