Hello,
I would like to use sympy in the following way :
1. The user types some formula like for example "2*x**3+5".
2. My little program named test.py must have to differentiate this
formula.
The problem is that the formula is known as a string.
Is there a way to not used string so as to
The problem is using strings directly in functions. The proper way to do this
is to convert the string to a SymPy object first with the sympify() function.
So for example, this would be perfectly legitimate:
from sympy import sympify, diff, S
from sympy.core.sympify import SympifyError # Note
That's sound great because that's the way I do.
Best regards.
Christophe.
2009/12/8 Aaron S. Meurer
> The problem is using strings directly in functions. The proper way to do
> this is to convert the string to a SymPy object first with the sympify()
> function. So for example, this would be
On Tue, Dec 8, 2009 at 7:59 AM, Aaron S. Meurer wrote:
> The problem is using strings directly in functions. The proper way to do
> this is to convert the string to a SymPy object first with the sympify()
> function. So for example, this would be perfectly legitimate:
> from sympy import sympify