Skip to content

kernc/PyCalc-NG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

PyCalc-NG

Infinite-precision desktop calculator app in ~50 lines of Python. No other dependencies—all the features. 🙌

Build status Language: shell / Bash Language: Python Source lines of code Script size Issues

Made as a dead-simple wrapper around Python that preimports stuff from its math and statistics modules (including numpy, if available) before dropping into the familiar REPL.

This replaces the functionality of several modern command-driven scientific calculators, as available e.g. in Debian, at less than half the source code lines spent! YMMV

Installation

Download the script and put it somewhere on $PATH:

curl -vL 'https://bit.ly/pycalc-ng' | sudo tee /usr/local/bin/pycalc sudo chmod +x /usr/local/bin/pycalc # Mark it executable

Make sure Python 3 is available:

sudo apt install python3

A terminal emulator (xterm from x11-utils (recommended), gnome-terminal or konsole) serves as a simple GUI:

sudo apt install x11-utils

If you use a tiling window manager, like i3, awesome, xmonad or dwm, additional utilities xprop and xdotool are required to make the app window dialog-like (floating):

sudo apt install x11-utils xdotool

If you prefer a more full-featured Python REPL, such as ptpython or ipython3 with syntax highlighting and Tab-based autocompletion, those are automatically used if found!

sudo apt install ptpython # or ipython3

Usage

Simple invocation should spawn a new app window:

$ pycalc

... in which you can type your fancy equations:

>>> 1+1 2 

Supports variable assignment just like Python does. Etc. 😋