Skip to main content

Yet another simple console menu

Project description

python-simple-menu

A lightweight console menu package for python applications. No frills, no fuss.

Installing

To install to your project, run the following command:

pip install python_simple_menu

How to use

def main():
    main_menu = Menu(prompt="Main Menu")
    main_menu.items.append(FunctionItem("Item 1", __item1))
    main_menu.items.append(FunctionItem("Item 2", __item2))
    
    sub_menu1 = Menu(prompt="Sub-Menu 1", parent=main_menu)
    sub_menu1.items.append(FunctionItem("Item 1", __item1))
    sub_menu1.items.append(FunctionItem("Item 2", __item2))
    
    main_menu.items.append(MenuItem(sub_menu1))    
    main_menu.run()

def __item1():
    print('lorem ipsum...')

def __item2():
    print('dolor sit amet...')

The menu will run until the user chooses Quit ("Q"), which will exit the application. If the menu has a parent menu, an additional Back ("B") option will be rendered which will return the user to the parent menu.

See the python_simple_menu/examples directory for other usages.

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

python_simple_menu-1.1.15b1.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

python_simple_menu-1.1.15b1-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file python_simple_menu-1.1.15b1.tar.gz.

File metadata

  • Download URL: python_simple_menu-1.1.15b1.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/37.3 requests/2.28.2 requests-toolbelt/0.10.1 urllib3/1.26.14 tqdm/4.64.1 importlib-metadata/4.13.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.8.10

File hashes

Hashes for python_simple_menu-1.1.15b1.tar.gz
Algorithm Hash digest
SHA256 117b18aabe73bfd3ac8e0ef7c69d57ae901429311c380e497c9bc1bbdd7c1a74
MD5 1659fd845f5b7fd614c55856cd549760
BLAKE2b-256 29c81628eb2a949cf39396e8153ecd57467f71024afe7761e72a77997bf7f080

See more details on using hashes here.

File details

Details for the file python_simple_menu-1.1.15b1-py3-none-any.whl.

File metadata

  • Download URL: python_simple_menu-1.1.15b1-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/37.3 requests/2.28.2 requests-toolbelt/0.10.1 urllib3/1.26.14 tqdm/4.64.1 importlib-metadata/4.13.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.8.10

File hashes

Hashes for python_simple_menu-1.1.15b1-py3-none-any.whl
Algorithm Hash digest
SHA256 c2fb3faff22af59fecc814e706c0fd0e1569d0dc5c9e9560289829db5617f102
MD5 61f7b3751c1125b2d86c8338ea6999c9
BLAKE2b-256 1b052680e1b05d6849c75b0e6c0040afc7a09c0b04804ef62867ec01f21615f5

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