Le dimanche 26 avril 2015 21:03:02 UTC+2, Aaron Meurer a écrit :
>
> On Sun, Apr 26, 2015 at 12:27 AM, Loïc Gouarin <[email protected] 
> <javascript:>> wrote: 
> > Hi, 
> > 
> > I would like to parse a string expression like that 
> > 
> > from sympy.parsing.sympy_parser import parse_expr 
> > parse_expr("m[0][0]") 
> > 
> > But I have an error with 'Symbol' object does not support indexing. 
> > 
> > If I do 
> > 
> > sympy.Symbol("m[0][0]") 
> > 
> > everything is ok. 
> > 
> > I try to write my own transformation funtion that takes the "m[x][y]" 
> and 
> > creates a Symbol and add it to the standard_transformations in 
> parse_expr 
> > but the problem is still the same because the problem is in auto_symbol 
> and 
> > it parses again my string 'm[x][y]'. 
>
> Does it work if you transform it literally to sympy.Symbol("m[0][0]")? 
>
> Hi Aaron,
 
your solution is almost what I want. There is no error in the parse_exp but 
I have in the result Symbol("m[x][y]") and not m[x][y]. I know thatit  is 
the same but I parse again the result and I need m[x][y]. 

Is there an easy way to have on the ouput m[x][y] and not Symbol("m[x][y]") 
?

Thanks,
Loic 

Aaron Meurer 
>
> > 
> > Could you tell me how I can do that ? 
> > 
> > Thanks, 
> > Loic 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "sympy" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to [email protected] <javascript:>. 
> > To post to this group, send email to [email protected] 
> <javascript:>. 
> > Visit this group at http://groups.google.com/group/sympy. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/sympy/b23973b8-0d28-4bf4-b863-404af71458d9%40googlegroups.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/99e82eff-77b2-45c3-9c2f-4340fcc188d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to