Skip to main content

A minimalistic command line menu

Project description

micromenu

CI and CD codecov PyPI PyPI - Downloads

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


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.3.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

micromenu-2.0.3-py2.py3-none-any.whl (5.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file micromenu-2.0.3.tar.gz.

File metadata

  • Download URL: micromenu-2.0.3.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6

File hashes

Hashes for micromenu-2.0.3.tar.gz
Algorithm Hash digest
SHA256 3225d76a4981397a3361f4f0fce42c8e65a19e889c445e65e75d1e9544047e5c
MD5 c9559fd39a15647507784816b752e03f
BLAKE2b-256 870746c24d207fa3a0488efa40b44a9c8c5e3ae92070547e7963325afb50f062

See more details on using hashes here.

File details

Details for the file micromenu-2.0.3-py2.py3-none-any.whl.

File metadata

  • Download URL: micromenu-2.0.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6

File hashes

Hashes for micromenu-2.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 7a0750daee8910007d9c40c0d7be45072317162cdccbc88a3cb6c6e536ca026a
MD5 aba1fa1843fae61c81b23b70b79231e1
BLAKE2b-256 ecb0a7c969dedc6cfaa94efbddb1f0fca858b394a3cdc609b476fed58f5e65dc

See more details on using hashes here.

Supported by

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