On Apr 9, 10:56 am, Joel Hedlund <joel.hedl...@gmail.com> wrote: > Hi all! > > I'm writing a program that presents a lot of numbers to the user, and I > want to let the user apply moderately simple arithmentics to these > numbers.
Joel - Take a look at the examples page on the pyparsing wiki (http:// pyparsing.wikispaces.com/Examples). Look at the examples fourFn.py and simpleArith.py for some expression parsers that you could extend to support whatever math builtins you wish. Since you would be doing your own parsing and eval code, you could be sure that no dangerous code was being run, just simple arithmetic. -- Paul -- http://mail.python.org/mailman/listinfo/python-list