Math Extensions for Ignition

In response to this thread, here is the updated app.math script.[attachment=2]math.py[/attachment]

Usage in a bit. Off to a meeting… :mrgreen:

EDIT: Adding a window to play with. I’d like to ask for the more deviously hacker-minded users to try to break it. That way it can be improved upon. :smiley:

Also, degrees and radians functions are commented out within evaluate(), since they aren’t supported in Ignition 7.2.x. Feel free to add them back in!

[attachment=1]eval.vwin[/attachment]

Some quick examples:

x=app.math.evaluate('5+7') print x x=app.math.evaluate('sqrt(pow(3,2)+pow(4,2))') print x x=app.math.evaluate('__import__("sys").stdout.write("Yep. Still evaluates...")') print x

[attachment=0]12-2-2013 10-28-16 AM.png[/attachment]