For posterity, here is a copy and pastable example of the equation
parser without the >>> and ... and line wrap problems:
s = '''
a=10
b=20
a*12+50*c==456+b
'''
def process_eqstrings(s):
eqs = []
for e in filter(None, s.strip().splitlines()):
parts = e.replace('==','=').split('=')
assert len(parts) == 2
eqs.append(Eq(*[S(ei) for ei in parts]))
return eqs
eqs = process_eqstrings(s)
print eqs
print solve(eqs)
OUTPUT:
[a == 10, b == 20, 12*a + 50*c == b + 456]
{a: 10, b: 20, c: 178/25}
--
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.