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.1.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.1-py2.py3-none-any.whl (7.1 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

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

File hashes

Hashes for pimento-0.5.1.tar.gz
Algorithm Hash digest
SHA256 a6c59ef6f607f87cf1363291a57546cfcbb1c1b8b051a8562328839efc4c7226
MD5 5847df34e566a4448fa36ecc877b8485
BLAKE2b-256 78e58f3e2a6c5e7e952adc8682297bf48328a20e890f4719eaec7d86ca9ccedc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pimento-0.5.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 35a8fb5341850dcd85c5e8dd47b170bebf0a89de812ae3d7984813cfb07d1ca8
MD5 50f408ac5a34aac47ab37a615ee3b69f
BLAKE2b-256 758ff88657c94c7673e145684bf192598e6cb56f4f4f0da0d9227596d769e578

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