Skip to main content

A simple console menu

Project description

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 simple_menu

How to Use

def main():
	# Create a main menu
	m = Menu(prompt="Main Menu")
	m.items.append(FunctionItem(label="Item 1", function=lambda: print("Item 1")))

	# Create a sub-menu
	m2 = Menu(parent=m, prompt="Sub Menu 1")
	m2.items.append(FunctionItem(label="Item 2", function=lambda: print("Item 2")))

	# Add the sub-menu to the main menu
	m.items.append(MenuItem(label="Sub Menu 1", menu=m2))

	# Run the menu
	m.run()


if __name__ == "__main__":
	main()

The menu will run until the user chooses the Quit item, which will exit the application. When entering a sub-menu, an additional "go back" option is added which will return the user to the parent menu. The various prompts can be customized in the Menu() constructor.

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.0.6.tar.gz (3.7 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.0.6-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file python_simple_menu-1.0.6.tar.gz.

File metadata

  • Download URL: python_simple_menu-1.0.6.tar.gz
  • Upload date:
  • Size: 3.7 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.1 requests-toolbelt/0.10.1 urllib3/1.26.13 tqdm/4.64.1 importlib-metadata/6.0.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.11.1

File hashes

Hashes for python_simple_menu-1.0.6.tar.gz
Algorithm Hash digest
SHA256 b971bb2f5480e6654658e2a0245926c22216570ef5280ca32d705db73c944234
MD5 4e0c45b4e2ab889207c784ff9db0c6af
BLAKE2b-256 0f8ed591580cf83f91fea29d9a02ff0eff22ae7b4dd25d0e58dd82c6fc5ee3e6

See more details on using hashes here.

File details

Details for the file python_simple_menu-1.0.6-py3-none-any.whl.

File metadata

  • Download URL: python_simple_menu-1.0.6-py3-none-any.whl
  • Upload date:
  • Size: 4.4 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.1 requests-toolbelt/0.10.1 urllib3/1.26.13 tqdm/4.64.1 importlib-metadata/6.0.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.11.1

File hashes

Hashes for python_simple_menu-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 9daa5f2d863300095624f261db66e1c026bffd1a8093721d4e1fbe7080df83fa
MD5 0963493e439d2de3a08e6d0ca7e23f5c
BLAKE2b-256 dfb98e3dcbfa1af48b199fceedc46532955305055b5b3a8ece55292be2ae47b7

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