Re: Best way to evaluate boolean expressions from strings?

2009-04-28 Thread Arnaud Delobelle
Gustavo Narea writes: > Hello, everybody. > > I need to evaluate boolean expressions like "foo == 1" or "foo ==1 and > (bar > 2 or bar == 0)" which are defined as strings (in a database or > a plain text file, for example). How would you achieve this? > > These expressions will contain placeholde

Re: Best way to evaluate boolean expressions from strings?

2009-04-28 Thread Gustavo Narea
Thank you very much, Gabriela and Peter! I'm going for Pyparsing. :) -- Gustavo. -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way to evaluate boolean expressions from strings?

2009-04-27 Thread Peter Otten
Gustavo Narea wrote: > I need to evaluate boolean expressions like "foo == 1" or "foo ==1 and > (bar > 2 or bar == 0)" which are defined as strings (in a database or > a plain text file, for example). How would you achieve this? > > These expressions will contain placeholders for Python objects (

Re: Best way to evaluate boolean expressions from strings?

2009-04-27 Thread Gabriel Genellina
En Mon, 27 Apr 2009 14:03:01 -0300, Gustavo Narea escribió: I need to evaluate boolean expressions like "foo == 1" or "foo ==1 and (bar > 2 or bar == 0)" which are defined as strings (in a database or a plain text file, for example). How would you achieve this? This recent thread may be of

Best way to evaluate boolean expressions from strings?

2009-04-27 Thread Gustavo Narea
Hello, everybody. I need to evaluate boolean expressions like "foo == 1" or "foo ==1 and (bar > 2 or bar == 0)" which are defined as strings (in a database or a plain text file, for example). How would you achieve this? These expressions will contain placeholders for Python objects (like "foo" an