p = Parser()
x = 0.00000002
p.parse('2*x').substitute('x', x)
Give this error:
File "/usr/local/lib/python3.5/dist-packages/py_expression_eval/init.py", line 87, in substitute
expr = Parser().parse(str(expr))
File "/usr/local/lib/python3.5/dist-packages/py_expression_eval/init.py", line 610, in parse
self.error_parsing(self.pos, 'unexpected variable')
File "/usr/local/lib/python3.5/dist-packages/py_expression_eval/init.py", line 639, in error_parsing
raise Exception(self.errormsg)
Exception: parse error [column 2]: unexpected variable
The following lines:
p = Parser() x = 0.00000002 p.parse('2*x').substitute('x', x)
Give this error: File "/usr/local/lib/python3.5/dist-packages/py_expression_eval/init.py", line 87, in substitute expr = Parser().parse(str(expr)) File "/usr/local/lib/python3.5/dist-packages/py_expression_eval/init.py", line 610, in parse self.error_parsing(self.pos, 'unexpected variable') File "/usr/local/lib/python3.5/dist-packages/py_expression_eval/init.py", line 639, in error_parsing raise Exception(self.errormsg) Exception: parse error [column 2]: unexpected variable