[Tutor] Evaluating a string expression
Serdar Tumgoren
zstumgoren at gmail.com
Thu Nov 5 14:28:12 CET 2009
> I'm afraid that your question doesn't pass the basic "Have I Googled it?"
> test. I stuck "evaluate a string expression in python" into Google and got:
>
> http://www.google.co.uk/#q=evaluate+a+string+expression+in+python
>
That search turns up a useful tutorial by effbot:
http://effbot.org/zone/librarybook-core-eval.htm
It covers the basics of how to safely use eval if the data is coming
from an untrusted source. Might be worth a look depending on your use
case.
More information about the Tutor
mailing list