Turning a string into an programatic mathematical expression

Daniel Bickett dbickett at gmail.com
Tue Oct 19 22:30:55 EDT 2004


The title really says it all. I'm trying to take input from a user
(intended to be a mathematical expression), from a text box for
example, and evaluate it mathematically within the program. For
clarification: the user inputs the string "4*5(3-3)", I would be
interested in a straight-forward way to find the result of that, based
only on a string. The follow-up question would be how to incorporate
variables into the mix, however I'll leave it at that for now. Thanks
for your time :)

Daniel Bickett



More information about the Python-list mailing list