A small calculator api for Python
Project description
Calculator API for Python
By White Night
Install
# Linux/macOS
python3 -m pip install -U whiteCalculator
# Windows
py -3 -m pip install -U whiteCalculator
QuickStart
>>> from whiteCalculator import Calculator
>>> c = Calculator()
>>> print(c.run("1+8(5^2)"))
201
>>> print(c.run("9Ans"))
1809
Errors
>>> from whiteCalculator import Calculator
>>> c2 = Calculator() # Default is True
>>> c2.run("9/0")
Error: division by zero
>>> c1 = Calculator(skipError=False)
>>> c1.run("9/0")
Traceback (most recent call last):
...
ZeroDivisionError: division by zero
Links
You can use:
- sin / asin / sinh
- cos / acos / cosh
- tan / atan / tanh
- ln / log
- × / •
- ^ / ** / power
- √ / sqrt
- π / pi
- %
- ÷
- Ans
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
whiteCalculator-0.0.2.tar.gz
(4.1 kB
view hashes)
Built Distribution
Close
Hashes for whiteCalculator-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82333c1e3db2f39665a2f342a57c3464dbe53920f3686d3f6205628d4e8c5343 |
|
MD5 | 695e77a2682c576459b98b05c285db75 |
|
BLAKE2b-256 | e8c957ea75bcb838b7929395bfaddb46990f97a12301fa4fc5d8476d38c122b0 |