I want to split the string using the arithmetic and logical operators present in the string. Sample string looks like as below a,b,c are constant value and its value has to fetched from database and compute the expression and return True or False
Eg:
'a >= 10 AND b >=20 OR c<=100'
or
'a >=10 OR b < 100 AND c = 100'
I need to split this based on OR, AND,NOT or any logical operators as
a >= 10
b >= 20
c <= 100
and compute the conditions with the operators(AND, OR ) given
Ex: a = 10 , b=25 , c=50
I need to evaluate like 10 >= 10 AND 25 >=20 OR 50 <=100
and return True
Is there any easy way to do this in python?