I have an object of class Employee.
# For Example
>>> employee1 = Employee()
I need to substitute the object employee1 in below expression. The expression will be dynamic
>>> expr = "object.basic_sal * 0.10 + 500"
For Example,
>>> employee1 = Employee()
>>> employee1.basic_sal = 10000
>>> expr = "object.basic_sal * 0.10 + 500"
>>> eval_expr(object=employee1, expression=expr)
1500
I could not find similar questions.
Please help me.