Skip to main content

Very simple Python calculator for your terminal

Project description

calcu

A simple calculator for your CLI.

(It uses Python's eval() and spits out the result, with some prettifying.)

example-gif

Installation

pip install calcu

Usage

Type c followed by your expression.

Example:

c 2+2
             = 4

Refer to the result of the previous calculation with an underscore _:

c _+10
             = 14

Do multiplication and exponentiation:

c 2 x 3^2
             = 18
# you can also use * and ** but then you must
# wrap your expression in quotes ' ' or bash will mess it up
# eg: c '2*3**2'

And dividing and brackets:

c [2+10]/10
             = 1.2
# as above, the square brackets are to stop bash cleverness
# if you want to use regular brackets, use quotes
# eg: c '(2+10)/10

Use any function from Python's math library:

c log[e] x pi
             = 3.141592654

It returns the appropriate number of decimal values, up to 9.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

calcu-0.9.8.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

calcu-0.9.8-py3-none-any.whl (3.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page