Simple CLI Menus
Project description
a simple CLI menu
There is a single required argument:
* items - a finite iterable (list, tuple, etc) of items which the user will be prompted to choose from
from pimento import menu
result = menu(['red', 'blue', 'green', 'grey'])
Prints:
Options:
red
blue
green
grey
Enter an option to continue:
There are many optional arguments:
from pimento import menu
result = menu(
['RED robin', 'Blue Bonnet', 'green GIANT'],
'Food Sources:',
'Select one [{}]:',
default_index=1,
indexed=True,
insensitive=True,
search=True
)
Prints:
Food Sources:
[0] 'RED robin'
[1] 'Blue Bonnet'
[2] 'green GIANT'
Select one [Blue Bonnet]:
Entering any of the following will get you a result of "Blue Bonnet":
* <enter>
* 1
* Bl
* bonnet
There is a standalone CLI tool of the same name ('pimento'), which is a wrapper for 'pimento.menu', and can be used to create simple menus quickly on the command line.
pimento has been tested on python 2.7.9 and 3.4.3 on OSX.
There is a single required argument:
* items - a finite iterable (list, tuple, etc) of items which the user will be prompted to choose from
from pimento import menu
result = menu(['red', 'blue', 'green', 'grey'])
Prints:
Options:
red
blue
green
grey
Enter an option to continue:
There are many optional arguments:
from pimento import menu
result = menu(
['RED robin', 'Blue Bonnet', 'green GIANT'],
'Food Sources:',
'Select one [{}]:',
default_index=1,
indexed=True,
insensitive=True,
search=True
)
Prints:
Food Sources:
[0] 'RED robin'
[1] 'Blue Bonnet'
[2] 'green GIANT'
Select one [Blue Bonnet]:
Entering any of the following will get you a result of "Blue Bonnet":
* <enter>
* 1
* Bl
* bonnet
There is a standalone CLI tool of the same name ('pimento'), which is a wrapper for 'pimento.menu', and can be used to create simple menus quickly on the command line.
pimento has been tested on python 2.7.9 and 3.4.3 on OSX.
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
pimento-0.5.1.tar.gz
(5.3 kB
view hashes)
Built Distribution
Close
Hashes for pimento-0.5.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35a8fb5341850dcd85c5e8dd47b170bebf0a89de812ae3d7984813cfb07d1ca8 |
|
MD5 | 50f408ac5a34aac47ab37a615ee3b69f |
|
BLAKE2b-256 | 758ff88657c94c7673e145684bf192598e6cb56f4f4f0da0d9227596d769e578 |