maicol07

Solution to SymPy parse_latex with exp

Apr 24th, 2020
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. raw_equation = self.equationLineEdit.text().replace("=0", "").replace("= 0", "").replace("e^", r"\exp(")
  2. # Fix exp (Add missing closing bracket)
  3. pos = raw_equation.find(r'\exp(')
  4. raw_equation = raw_equation[:pos] + raw_equation[pos:len(r'\exp(') + 2] + ")" + raw_equation[ pos + len(r'\exp(') + 1:]
Add Comment
Please, Sign In to add comment