Python is a dynamic scripting language. If you have a user-entered expression, Python will happily run it as python code using the eval function. Arithmetic expressions are valid Python code.
For example, put a Text Field, Button, and Label on a window. Put this code on the button:
[code]textField = event.source.parent.getComponent(“Text Field”)
label = event.source.parent.getComponent(“Label”)
expression = textField.text
result = eval(expression)
label.text = str(result)[/code]
Ta-da!
[color=#FF4000]Obligatory Warning[/color]: You’d better trust the user typing into the text box, because if they’re malicious, they could run any Python code they want, which could be bad.