You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sympy
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?
Luv Agarwal
unread,
Apr 7, 2016, 8:50:31 AM4/7/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sympy
Also, is this the right place to ask questions?
Oscar Benjamin
unread,
Apr 7, 2016, 9:30:44 AM4/7/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sympy
On 7 April 2016 at 13:50, Luv Agarwal <luvaga...@gmail.com> wrote:
> Also, is this the right place to ask questions?
It is although I don't know the answer to your question. Be patient...
Aaron Meurer
unread,
Apr 7, 2016, 2:07:57 PM4/7/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sy...@googlegroups.com
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\")}'