Skip to main content

A simple package to create text menus for use in console applications

Project description

quick-menu

PyPI - Version PyPI - Python Version


This is a simple package to create text menus for use in console applications.

Usage

A menu can be created quickly that can call a function with or without a value. An exit item is automatically added to the menu.

Create a Quick Menu

from quick_menu.menu import Menu, MenuItem

def func(val=1):
    print("func1: val =", val)
    input("Press [Enter] to continue")

menu = Menu(
    "Simple Menu",
    menu_items=[
        MenuItem("1", "Func default", action=func),
        MenuItem("2", "Func with val=4", action=func, action_args={"val": 4}),
    ]
)

menu.run()

Output

============== Simple Menu =============
1: Func default
2: Func with val=4
X: Exit
========================================
>> 1
func1: val = 1
Press [Enter] to continue

============== Simple Menu =============
1: Func default
2: Func with val=4
X: Exit
========================================
>> 2
func1: val = 4
Press [Enter] to continue

Documentation

The documentation is made with Material for MkDocs and is hosted by GitHub Pages.

Installation

pip install quick-menu

License

quick-menu is distributed under the terms of the MIT license.

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

quick_menu-0.6.0.tar.gz (9.0 kB view hashes)

Uploaded Source

Built Distribution

quick_menu-0.6.0-py3-none-any.whl (5.4 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