I was unaware of the exec and eval functions in Python. Without trying
them, they seem to be what I want to do. I'll play around with it and
see if I can figure it out. Thanks for the suggestions everyone.
Jeremy
--
http://mail.python.org/mailman/listinfo/python-list
Nick Vatamaniuc wrote:
> Jeremy,
>
> Which method of extension are you using? For example you can pass the
> function to C++/C directly using weave, without the need to convert to
> Python first. Python has a different syntax than C++. Also I assume you
> want exponentiation in you example "x^2...
Jeremy,
Which method of extension are you using? For example you can pass the
function to C++/C directly using weave, without the need to convert to
Python first. Python has a different syntax than C++. Also I assume you
want exponentiation in you example "x^2..." and not 'xor', well, in
Python th
jeremito wrote:
> 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
Em Ter, 2006-08-01 às 18:45 -0700, jeremito escreveu:
> 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.
I may be wrong, but I don't think you can create new C++ functions
on-the-fly. At least I