A minimalistic command line menu
Project description
micromenu
A minimalistic command line menu for Python, with a title and optional message bars. 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 │
╰────────────────────────────────────────────────────────╯
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.
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_function_item("item2", lambda x: print(x), {'x':"testparam"}))
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-1.1.0.tar.gz
(3.8 kB
view hashes)
Built Distribution
Close
Hashes for micromenu-1.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48e744fbd323a38170d68993d2e0ecb1068b9bdb32e26f86f346270a5a8620c1 |
|
MD5 | c39011681117ee2b551951d30b663f66 |
|
BLAKE2b-256 | 1dcc6681e16e3562e4af7cfe7dd651b594e99cfb1e2f29e2f1eb696937c42251 |