I wanted to know How can I convert string to python defined variables.
Basically I want to do this.
if value1 operator value2:
print True
my operator is a string '==' , '>', '<', '!='
so that it becomes
if value1 == value2:
print True
I tried operator = getattr(sys.modules[__name__], operator ) but it work for class.
thanks.