Conditionals stored as text to translate to real compares

2006-01-13 Thread Randall Parker
I want to know if there is some way to translate fragments of text into operators (e.g. <, >, <>, ==, etc) to use in conditional expressions. I've got a data structure which is a list of lists. A single list might look like: MyInnerList = ["MyVar",">",7] or MySecondInnerList = ["MyOtherVar","<=",

Re: Conditionals stored as text to translate to real compares

2006-01-12 Thread Mike Meyer
"Randall Parker" <[EMAIL PROTECTED]> writes: > if OperatorType == ">": ># then do a greater than compare here. >BoolVal = TestVal > TargetVal > elif OperatorType == ">=": ># then do a greater or equal to here. >BoolVal = TestVal >= TargetVal > and so on. > > It would seem a lot eas