From string to sympy expression
sympify()
uses eval()
which is dangerous. Use sympy.parsing.sympy_parser.parse_expr()
instead.
The function you're looking for is sympify
. http://docs.sympy.org/latest/modules/core.html#sympy.core.sympify.sympify