Menu for command line
Project description
terminaloptions
Menu for command line applications.
Installation
pip install terminaloptions
Usage
from terminaloptions import Menu
options = [
'Option 1',
'Option 2',
'Option 3',
]
menu = Menu(options) # Create a new menu.
# Running menu will print the options and wait for the user to select one.
# Use the arrow keys to navigate and enter to select.
selection = menu.run_menu() # Returns the selected option.
Other arguments for run_menu
method:
title
: str | None = None -> Show a title for the menu.get_index
: bool = False -> Return the index of the selected option.help
: bool = True -> Show a short help message at the top of the menu.
Next features
- [ ] Add support for submenus.
- [ ] Customise the appearance of the menu.
- [ ] Add support for custom key bindings.
- [ ] Add support for custom actions.
- [ ] Add support for custom help messages.
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
terminaloptions-1.0.0.tar.gz
(4.4 kB
view hashes)
Built Distribution
Close
Hashes for terminaloptions-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc64b1aa1b149f6735cbc4cec21802e22159d639c02b3366df8f6b76fcdd978a |
|
MD5 | eb93bf92cdc034b99acd36c1000df061 |
|
BLAKE2b-256 | 02bc971748756cc7032a02c6f43afe9a32e55a5f376defde0d26985ba7c836e1 |