Equation parsing in Python
- by MikeCroucher
How can I (easily) take a string such as
'sin(x)*x^2'
which might be entered by a user at runtime and produce a python function that could be evaluated for any value of x? Does anyone know of any libraries or modules that takes care of this sort of thing?