_         _                                                   
     (_)       | |                                                  
      _  _____ | |___  ___ _  _____ __    __    __  __ _   _  ____  
     | |(  _  )|  _  )(  _` ||  _  )\ \  / /    \ \/ /| | | |(__  / 
     | || (_) || | | || (_| || | | | \ \/ /  _   )  ( | |_| |  / /_ 
   _ | |(_____)|_| |_|(___,_||_| |_|  \__/  (_) /_/\_\(____ | /____)
  | || |                                               ___| |       
  (____)                                              (_____)       

Command-line Calculator

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