Skip to main content

Simple Term Menu with support for another print

Project description

fork of https://github.com/IngoMeyer441/simple-term-menu but add a new parameter: print_entry_fn

This parameter allow you to control how to print each entry.
example: use rich to print text

from rich_simple_term_menu import TerminalMenu
from rich.console import Console

console = Console()

options = ["[bold gold1]entry 1", "entry 2", "entry 3"]

# Add the new `print_entry_fn` to control how to print each entry! 
terminal_menu = TerminalMenu(options, print_entry_fn=lambda x: console.print(x, end=''))

menu_entry_index = terminal_menu.show()
print(f"You have selected {options[menu_entry_index]}!")

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

rich_simple_term_menu-0.1.0.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

rich_simple_term_menu-0.1.0-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file rich_simple_term_menu-0.1.0.tar.gz.

File metadata

  • Download URL: rich_simple_term_menu-0.1.0.tar.gz
  • Upload date:
  • Size: 18.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.1 CPython/3.11.2 Darwin/22.4.0

File hashes

Hashes for rich_simple_term_menu-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4ff5f11b47625e3cc3da8bdea2fb3c8eca2af28bc26d88be78b377ee119e0f6a
MD5 8cdbf025b36342ec6911c31b0228b0ff
BLAKE2b-256 f679731d830c66c54b19defc78e48d5ce1c135aecb66e99f5a8fbdf0499d926b

See more details on using hashes here.

File details

Details for the file rich_simple_term_menu-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for rich_simple_term_menu-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d11f6ab3caf0d02f8008d95909576b9e07e82b40ca31ae270194d28bf2ad25c9
MD5 9991af6768223bdd90e11fe4a8bd6b43
BLAKE2b-256 8267d256b3ff4feab38f1128284689d79e3d304a2cea7e189a9ff29a71ccab95

See more details on using hashes here.

Supported by

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