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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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