Skip to main content

Easy customizable menu for CLI

Project description

GitHub Repository Latest PyPi version
supported Python versions Project licence
Number of PyPi downloads

Python - PyeMenu Version 0.1.0

PyeMenu is a simple and interactive CLI menu for Python apps 'by now' It is intend in future to add more features including other types of menus as checkbox an similars. Right now, it is possible to customize the title and the cursor 'icon'

Installation

Simply installing it via pip:

pip install pyemenu

or installing manually as follow:

For manually installing this module you can download this repo as .zip file and unzip where You need it

After unziping Don´t forget to install requierements.txt via pip install as follow

pip install -r requirements.txt

Requierments

This package uses python module readchar in their last version.

Copyright (c) 2014-2022 Miguel Ángel García

Usage

this module is very simple for using it. 'by now' for example you can use menu() function for printing a menu list giving it a list with the options you want to prompt where each value could be a choice you want to print in the CLI

for example

import pyemenu

# Options for an app running in the CLI
options = [
             "Create",
             "Delete", 
             "Show",
             "Restore"]
    choice = pyemenu.menu("My App", options, col=1)
    print(f"Your choice was {choice}")
# function print_menu return the choice selected pressing ENTER 
choice = pyemenu.menu("Title", options)
print(f"\n Your choice was {choice}")
Example number 1

or for example passing a different quantity of columns, col value is 1 by default but you can change it as you most like and arrange the options in the number of columns specified in parameter col

import pyemenu

# Options for an app running in the CLI
options = [
             "Poodle",
             "Chihuaha",
             "Golden",
             "Dalmata",
             "Galgo",
             "German Shepard",
             "Border Collie",
             "Corgie",
             "Mine"]
choice = pyemenu.menu("What is your favorite Dog", options, col = 3)
print(f"Your choice was {choice}")
Example number 1

Even it is possible to change the chars that build the cursor. For example, so if you have a cool font installed you can use a cool shape for your cursor.

import pyemenu

# Options for an app running in the CLI
options = [
             "North",
             "South",
             "East",
             "West"]
choice = pyemenu.menu("Where do you want to go?", options, col=2, cursor="󰮯 ")
print(f"Your choice was {choice}")
Example number 1

OS Support

Right now it only been tested on Windows Os and Linux Os


LICENSE

PyeMenu is using a MIT license

Copyright (c) 2014-2023 Freire Alexander Palomino Palma

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

pyemenu-0.1.0.tar.gz (5.3 kB view hashes)

Uploaded Source

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