Command line menu selector.
Project description
menuchoice
Command line menu selector
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.4.tar.gz
(5.6 kB
view hashes)