Command-line Calculator: The tool you didn't know you needed, and in fact, didn't need!

📅

Download .zip file

This is a calculator that you can run in a command line terminal. To run it, you need Python 2 or 3.

You can either use argument mode:

$ ./calculator.py '1+1'
2

or interpreter mode:

$ ./calculator.py
Type help for more info.
~ 1+1
2
~ 123sin(4!rad(56+log4))/(3+ln(3!))
-25.390453736
~

In both modes, you can assign variables with either of the following:

83->abc
83@abc

And access them like this:

3+abc
86
cos abc
0.249540117973

To see more of the features, type help in interpreter mode or run ./calculator.py help [page #].

Download terminal colors python module

This site's source code is released under the MIT License.