Quantcast
Channel: MarsHut
Viewing all articles
Browse latest Browse all 6551

How do I print equality?

$
0
0
Hello SymPy users,

Suppose I have a = b**2, and I want to pprint:

a = b

How can I do it? The closest I can get is:

#!/usr/bin/python
from sympy import *
var("a b")
a = b**2
pprint({"a": a)

But it

- prints : instead of = and also
- prints ugly {} around equality (or assignment).

Ideally I want something like:

pprint(a.__name__ + " = " + a)

Viewing all articles
Browse latest Browse all 6551