Skip to main content

Python menu for CLI

Project description

PyCLIMenu

CLI Menu module for Python.

Usage

Standard usage

from pyclimenu import menu

main_menu = menu.Menu("Main Menu")

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

main_menu.display()

Alternatively...

from pyclimenu import menu

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

Option menu

from pyclimenu 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...

from pyclimenu 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

climen-0.1.0.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

climen-0.1.0-py3-none-any.whl (4.0 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