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 details)

Uploaded Source

File details

Details for the file pyemenu-0.1.0.tar.gz.

File metadata

  • Download URL: pyemenu-0.1.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for pyemenu-0.1.0.tar.gz
Algorithm Hash digest
SHA256 33009dec210bc9de60bd4ca3a5798d2545098ca07d24daff20834c69debb713b
MD5 deb5b6a5ae9983f80677671803b6db5d
BLAKE2b-256 c724d027da886b6b209613c7519ca8ee244fcf4a38ab2c9b4cf8cd8c04c060fe

See more details on using hashes here.

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