Simple calculator based on Abstract syntax tree. In this case Python's AST.
Interactive mode:
./calc.py
One off evaluation from command line:
./calc.py "1 + 2"
Evaluation of all expression in the file:
./calc.py -f input_file
Help, as always:
./calc.py --help
To run test execute:
python -m unittest discover
- All operators defined in ast
- Functions: log, exp, sqrt, sin, cos
- Const: pi, e
- All other things ;) That included executing Python code