Can you add a simple calculator function?

if you have Python installed, you can create a calculator custom command, as follows.

In listary options, keywords, custom, add a new command by pressing +,
Give it a keyword and title, I used
Keyword: Calc, and
Description: Runs the calculation in the python interpreter and outputs to screen. Also launches Python interpreter for further commands
Then enter path:
cmd
and Parameter:
/c echo from __future__ import division; __builtins__._ = {query}; print _ > %TEMP%\c.py && python -i %TEMP%\c.py

once you apply/save this, you can run a quick calculator as follows:
calc 1+1
or
calc (100-30) / 10

Once launched, you have the Python interpreter and can continue to calculate, including by referring to the previous calculation output, with underscore.

For example, from the previous example, you get:-

7.0
>>> 

By entering _ + 3 you get the answer:
10

edit: Updated to take into account that division shouldn’t give a rounded up or down integer

2 Likes