Is \00\ supposed to be a symbol named "\00\"? If so, you can wrap it
with Symbol and a string like Symbol(r"\00\"). That is

s = 'L*P**2*Q**3{-b*l*conjugate(p)*Symbol(r"\00\") + -a*p*q**3*Symbol("\11\")}'

Aaron Meurer

On Thu, Apr 7, 2016 at 7:32 AM, Luv Agarwal <[email protected]> wrote:
> Hey, I am doing some calculations. I wanted to print the following string as
> pretty_print:
>
> s = 'L*P**2*Q**3{-b*l*conjugate(p)|00\ + -a*p*q**3|11\}'
>
> One way I could think is to apply parse_expr first and then pretty print but
> it can't take '\'s and brackets (Is there any way to ignore these characters
> or take them as symbols?). Other way I tried is to parse the string in parts
> (so that I can ignore the unparsable characters by not parsing them and
> print them later separately) and then pretty_print them with spaces between
> them. But I couldn't find any way to pretty print multiple expressions or
> strings with spaces between them. I tried doing pretty_print(L*P**2*Q**3),
> pretty_print('{'). But it's still printing newlines between them.
>
> How should I do it?
>
> --
> 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 https://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/7e24e95b-5b81-4451-b1d8-0798cf2dab5c%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 https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAKgW%3D6%2B6qrznRxF2ij0TW9v%2BQkuavDMDURudeF1Ma2GAf0txyg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to