Simple wrapper that helps you write a menu driven program easily.
Project description
mendi
Simple wrapper that helps you write a menu-driven program easily.
A menu-driven program is one, which the user is provided a list of choices. A particular action is done when the user chooses a valid choice. There is also an exit option, to break out of the loop. Error message is shown on selecting a wrong choice.
Installation
pip install mendi
Usage
This is a simple snippet showing you the use of mendi
from mendi import drive_menu
a = int(input('Enter a number: '))
def add():
print(a+1)
def substract():
print(a-1)
options = {}
options['1'] = {'desc': 'Add', 'func': add}
options['2'] = {'desc': 'Substract', 'func': substract}
drive_menu('Calculate', options)
Here is a sample output:
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
mendi-0.0.1.tar.gz
(2.5 kB
view hashes)
Built Distribution
mendi-0.0.1-py3-none-any.whl
(2.5 kB
view hashes)