console toolbox
Project description
prototools
__ __ __
___ _______ / /____ / /____ ___ / /__
/ _ \/ __/ _ \/ __/ _ \/ __/ _ \/ _ \/ (_-<
/ .__/_/ \___/\__/\___/\__/\___/\___/_/___/
/_/
prototools
is a set of tools that considerably reduce the amount of time
spent writing console applications.
Installation
prototools
is available on PyPi (MIT license)
and installation can be performed by running pip
python -m pip install prototools
To upgrade the package:
python -m pip install prototools --upgrade
๐ It's recommended to use virtual environment.
To delete the package:
python -m pip uninstall prototools
Example
from prototools import Menu, float_input
def _user_input(f):
x = float_input("First number: ")
y = float_input("Second number: ")
print(f"Result: {f(x, y)}")
def addition(x, y):
return x + y
def substraction(x, y):
return x - y
def multiplication(x, y):
return x * y
def division(x, y):
try:
return x / y
except ZeroDivisionError:
return "Can't divide by zero"
def about():
print("Just Another Simple Calculator")
def main():
menu = Menu()
menu.add_options(
("Addition", lambda: _user_input(addition)),
("Substraction", lambda: _user_input(substraction)),
("Multiplication", lambda: _user_input(multiplication)),
("Division", lambda: _user_input(division)),
("About", about),
)
menu.run()
if __name__ == "__main__":
main()
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โ Menu โ
โ โ
โ โ
โ 1 - Addition โ
โ 2 - Substraction โ
โ 3 - Multiplication โ
โ 4 - Division โ
โ 5 - About โ
โ 6 - Exit โ
โ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
>
Documentation
You can read the documentation at aquรญ
Contribution
You can contribute with prototools
in so many ways (not just coding).
Every idea is welcome! You can suggest new features or report a bug when
you find it. Every contribution that you made it'll be mention in this
project.
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
prototools-0.1.12.tar.gz
(39.2 kB
view hashes)
Built Distribution
Close
Hashes for prototools-0.1.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6933ce1c5d42c318402203af2ec8778541f190f40e9a9fb8128901497757ec94 |
|
MD5 | 11e28de0337b3d85616571a24d4c48d0 |
|
BLAKE2b-256 | 3267279d802ca9a2d4880fcc7abc64304fd9e237cbdec459e920867e73862d5a |