Translates infix formulas into MathML and vice-versa.
57 def translateInfix(formula):
69 def translateMathML(xml):
75 """Usage: readSBML filename 78 print(
"This program translates infix formulas into MathML and")
79 print(
"vice-versa. Enter or return on an empty line triggers")
80 print(
"translation. Ctrl-C quits")
85 print(
"Enter infix formula or MathML expression (Ctrl-C to quit):")
88 line = sys.stdin.readline()
89 while line
is not None:
90 trimmed = line.strip()
98 result = translateMathML(str)
100 result = translateInfix(str)
102 print(
"Result:\n\n" + result +
"\n\n")
106 line = sys.stdin.readline()
112 if __name__ ==
'__main__':