Skip to content

yqbear/quick-menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages