Python Forum
problem using pyeval_expression
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problem using pyeval_expression
#6
(Oct-31-2023, 10:57 AM)akbarza Wrote: I used cmd for the command: pip install py-expression-eval
and then I changed the code to:
Then you most follow the Doc py-expression-eval.
>>> from py_expression_eval import Parser
>>> 
>>> parser = Parser()
>>> p = parser.parse('53 * (-4) +2 * 3')
>>> p.evaluate({})
-206
Or Simpleeval.
>>> from simpleeval import simple_eval
>>> 
>>> simple_eval(" 53 * -4 +2 * 3 ")
-206
akbarza likes this post
Reply


Messages In This Thread
problem using pyeval_expression - by akbarza - Oct-30-2023, 10:25 AM
RE: problem using pyeval_expression - by deanhystad - Oct-30-2023, 11:33 AM
RE: problem using pyeval_expression - by snippsat - Oct-30-2023, 01:05 PM
RE: problem using pyeval_expression - by popejose - Oct-30-2023, 02:30 PM
RE: problem using pyeval_expression - by akbarza - Oct-31-2023, 10:57 AM
RE: problem using pyeval_expression - by snippsat - Oct-31-2023, 01:37 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020