https://github.com/kernc/pycalc-ng
Infinite-precision desktop calculator app in ~50 lines of Python
https://github.com/kernc/pycalc-ng
arbitrary-precision arbitrary-precision-arithmetic arbitrary-precision-integer calculator calculator-app calculator-application calculator-python desktop-calculator-app infinite-precision infinite-precision-arithmetics infinite-precision-calculator xterm
Last synced: 3 months ago
JSON representation
Infinite-precision desktop calculator app in ~50 lines of Python
- Host: GitHub
- URL: https://github.com/kernc/pycalc-ng
- Owner: kernc
- License: agpl-3.0
- Created: 2025-10-06T20:32:14.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2025-10-06T20:49:39.000Z (3 months ago)
- Last Synced: 2025-10-06T22:28:28.129Z (3 months ago)
- Topics: arbitrary-precision, arbitrary-precision-arithmetic, arbitrary-precision-integer, calculator, calculator-app, calculator-application, calculator-python, desktop-calculator-app, infinite-precision, infinite-precision-arithmetics, infinite-precision-calculator, xterm
- Language: Shell
- Homepage: https://github.com/kernc/pycalc-ng
- Size: 14.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
PyCalc-NG
=========
**Arbitrary-precision arithmetic desktop calculator app in ~50 lines of Python.**
No other dependencies—all the features. 🙌
[](https://github.com/kernc/pycalc-ng/actions)
[](https://github.com/kernc/pycalc-ng)
[](https://github.com/kernc/pycalc-ng)
[](https://ghloc.vercel.app/kernc/pycalc-ng)
[](https://github.com/kernc/pycalc-ng)
[](https://github.com/kernc/pycalc-ng/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`:
```sh
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:
```sh
sudo apt install python3
```
A terminal emulator (`xterm` from _x11-utils_ (recommended), `gnome-terminal` or `konsole`)
serves as a simple GUI:
```sh
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):
```sh
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!
```sh
sudo apt install ptpython # or ipython3
```
Usage
-----
Simple invocation should spawn a new app window:
```sh
$ pycalc
```
... in which you can type your fancy equations:
```python-repl
>>> 1+1
2
```
Supports variable assignment just like Python does. Etc. 😋