Skip to main content

Python menu for CLI

Project description

PyCLIMenu

CLI Menu module for Python.

Usage

Standard usage

import menu

main_menu = menu.Menu("Main Menu")

main_menu.add_items({
    "Option 1": callback_1,
    "Option 2": callback_2
})

main_menu.display()

Alternatively...

import menu

menu.BasicMenu("Main Menu", {
    "Option 1": callback_1,
    "Option 2": callback_2
})

Option menu

import menu

color_menu = menu.OptionMenu("Color")

red = (255, 0, 0)
green = (0, 255, 0)
blue = (0, 0, 255)

color_menu.add_items({
    "Red": red,
    "Green": green,
    "Blue": blue
})

color = color_menu.display()

Alternatively...

import menu

color_menu = menu.BasicOptionMenu("Color", {
    "Red": (255, 0, 0),
    "Green": (0, 255, 0),
    "Blue": (0, 0, 255)
})

color = color_menu.selection

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

climenu-pkg-baely-0.0.1.tar.gz (1.6 kB view hashes)

Uploaded Source

Built Distribution

climenu_pkg_baely-0.0.1-py3-none-any.whl (2.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