Constructing an if statement from the client data in python

Vishal Rana ranavishal at
Tue Apr 13 11:56:04 EDT 2010


I need to construct an if statement from the data coming from the client as

conditions: condition1, condition2, condition3, condition4 logical
operators: lo1, lo2, lo3 (Possible values: "and" "or")


if condition1 lo1 condition2 lo3 condition4:
    # Do something

I can think of eval/exec but not sure how safe they are! Any better approach
or alternative? Appreciate your responses :)

PS: Client-side: Flex, Server-side: Python, over internet


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list