Skip to main content

Command line menu selector.

Project description

menuchoice

Pepy Total Downlods GitHub repo size

Command line menu selector

menuchoice-demo2

Usage

Creating a selection menu:

import menuchoice
myMenu = menuchoice.MenuSelector(items=[
    "Hip-hop",
    "Rock",
    "Pop",
    "Country",
    "EDM",
], title="Most Streamed Music USA", description="Select a genre of music.")

[!TIP] items can be given brief descriptions if they are type dictionary. {"option": "brief description"}

Selecting an option:

myMenu.prompt_select() # basic user-input method
myMenu.arrow_select()

Output:

[(4, "EDM")]

Additionally, multiple options can be selected

# no less than 2, no more than 3
myMenu.arrow_select(max_items=(2, 3))
# Adds an option to select all items
myMenu.arrow_select(allow_all=True)

Output:

[(4, "EDM"), (1, "Rock")]

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

menuchoice-0.5.tar.gz (5.6 kB view hashes)

Uploaded Source

Built Distribution

menuchoice-0.5-py3-none-any.whl (6.3 kB view hashes)

Uploaded Python 3

Supported by

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