How do I convert arithemtic string (like "2+2") to a number?

Adomas adomas.paltanavicius at gmail.com
Sun Feb 6 06:00:33 EST 2005


Well, a bit more secure would be

eval(expression, {'__builtins__': {}}, {})

or alike.




More information about the Python-list mailing list