Skip to main content

Very simple Python calculator for your terminal

Project description

calcu

publish

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-1.0.0.tar.gz (91.6 kB view details)

Uploaded Source

Built Distribution

calcu-1.0.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file calcu-1.0.0.tar.gz.

File metadata

  • Download URL: calcu-1.0.0.tar.gz
  • Upload date:
  • Size: 91.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for calcu-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5e3d4b90d0eb62bcdfa965966619c35bf7a7a41d99b3608a2e46f14c895f85f4
MD5 c72843f0f618be1137bd557fe43c8235
BLAKE2b-256 a8316148c978bad2a3b62fb33af4a6f588c74c17ed4993859b79ec8bd42bb5d2

See more details on using hashes here.

File details

Details for the file calcu-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: calcu-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for calcu-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a778f84533291da41b96bd2977da632228311e5eb6ab49290e1d0f2cb5091b59
MD5 b96ef0d752cf92a8c01993d3dbe3e146
BLAKE2b-256 c806f225e949d9bc021f118e6aa7c9a8a4c936785d6dcb0b0a795720736e6eeb

See more details on using hashes here.

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