On 11/04/2011 03:34 PM, gsagrawal wrote:
> Hi ,
>
> I am trying to parse some mathematical expressions using /sympify/ from
> string format to sympy format.
> But if my expression is like "/(x+y)(x-y)/" ,i am getting TypeError
> exception (Add is not a callable ). I know i am missing one/*/ symbol in
> between these brackets (correct expression is /(x+y)*(x-y)/ ) . but As
> i am taking this expression input from User , so is there any way to
> handle this exception and any way to get specific section where i missed
> this multiplication symbol ?
>
> Thanks,
I would use the workarround:
txt = "(x+y)(x-y)"
txt = txt.replace( ')(' , ')*(' )
expr = sympify(txt)
but maybe thats not general enough...
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy?hl=en.