Skip to main content

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.

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

pimento-0.5.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pimento-0.5.0-py2.py3-none-any.whl (7.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pimento-0.5.0.tar.gz.

File metadata

  • Download URL: pimento-0.5.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pimento-0.5.0.tar.gz
Algorithm Hash digest
SHA256 8d4eea30c473247e7aae7c9fc3add935511ab5ca9a9e79c9fc0f51db2af38254
MD5 2826dda85488bef9d452713a2b36e2b7
BLAKE2b-256 2419e70050f45efb032a15b43bd8a241f560bc7f27af756a0851e11adeeb829c

See more details on using hashes here.

File details

Details for the file pimento-0.5.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pimento-0.5.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3e95c8f9c020d8216529af88ddfe2ffe28f2294d3a28996ba84a368540d2bcad
MD5 8c2978550452ac7c4b1672ac35e0d2ea
BLAKE2b-256 7ef2428d718e9448b2b22ea859d660ef74c2c8d510cf40b4ef399bc7fbce71dc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page