Skip to content
Flavio Lionel Rita edited this page Apr 25, 2021 · 1 revision

Exp

Exp is the main class of the library that contains the methods to parse, evaluate, get info of expression, etc . In order to use the library you need to create an instance of this class:

from py_expression.core import Exp
exp = Exp()

Parse

from py_expression.core import Exp
exp = Exp()
operand =exp.parse('a+4')

Eval

from py_expression.core import Exp

exp = Exp()
operand =exp.parse('a+4')
result = exp.eval(operand,{"a":2})
from py_expression.core import Exp

exp = Exp()
operand =exp.parse('a+4')
result = operand.eval({"a":2})
from py_expression.core import Exp

exp = Exp()
result =exp.parse('a+4').eval({"a":2})
Clone this wiki locally