A minimalistic command line menu
Project description
micromenu
A minimalistic command line menu for Python, with a title and optional message bars and dividers. Callable functions are attached to each menu item.
╭─── This is a title ────────────────────────╮
│ Message that shows on top │
╞════════════════════════════════════════════╡
│ 1: Menu item 1 │
│ 2: Menu item 2 │
│ 3: Menu item 3 │
├────────────────────────────────────────────┤
│ 0: Exit │
├────────────────────────────────────────────┤
│ Bottom message row 1 │
│ Bottom message row 2 │
╰────────────────────────────────────────────╯
Action number:
Set the parameter cycle=False
if the menu should not loop back after an item has been executed. menu.show()
will return True
after terminating.
add_function_item
has an optional parameter uid
which can be used to address the menu options without using the index numbers.
Installation
python3 -m pip install micromenu
Example usage
import micromenu
menu = micromenu.Menu("test", "this is a message", "and a bottom message", min_width=25)
menu.add_function_item("item1", lambda x: print(x), {'x':"testparam"})
menu.add_divider()
menu.add_function_item("item2", lambda x: print(x), {'x':"testparam"}))
menu.add_message_bottom_row("bottom msg")
menu.show()
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
micromenu-2.0.2.tar.gz
(4.5 kB
view hashes)
Built Distribution
Close
Hashes for micromenu-2.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69980f203049028069e94c65b679f73df3e74df2cf159b83f13b0a971aa4ec4f |
|
MD5 | 5d17e1cf9a3f5d4ff3ccd793b1bdba1b |
|
BLAKE2b-256 | 4aa15cc3f8d332f68d0cad9b6a4470bc458c3494231dee22ddd20986820ca5d9 |