Convert string to mathematical function

jeremito jeremit0 at gmail.com
Tue Aug 1 21:45:08 EDT 2006


I am extending python with C++ and need some help.  I would like to
convert a string to a mathematical function and then make this a C++
function.  My C++ code would then refer to this function to calculate
what it needs.  For example I want to tell my function to calculate
"x^2 + 3x +2", but later on I may want: "x + 3".  Does anybody know how
I can get an arbitrary string in Python (but proper mathematical
function) turned into a C++ function?  My one idea (although I don't
know how to implement it, I'm still new at this) is to pass to C++ a
pointer to a (Python) function.  Will this work?
Thanks,
Jeremy




More information about the Python-list mailing list