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

Uploaded Source

Built Distribution

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

quick_menu-0.6.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file quick_menu-0.6.0.tar.gz.

File metadata

  • Download URL: quick_menu-0.6.0.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.24.0

File hashes

Hashes for quick_menu-0.6.0.tar.gz
Algorithm Hash digest
SHA256 4ec8b67164df607dee72576e7e79915155840230922121637dd855e42ba61f9e
MD5 cc99fe42f680b6ff354688d226d12608
BLAKE2b-256 eec6221d5ad74dd4e7a91197661c74a82682b4e344f9a5eed7c659b612748055

See more details on using hashes here.

File details

Details for the file quick_menu-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: quick_menu-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.24.0

File hashes

Hashes for quick_menu-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1132ac51b92ca12e5481616573e76e31355bf17ecc5911251cb74320ed199778
MD5 e429cfe978055b8765ad4b278d108956
BLAKE2b-256 a1a073279f8e2e3f627989662ea0b5b0aca3023338177d68daba09a69c5818ca

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