Skip to main content

Simple Python menu generator

Project description

GaleMenu - Simple Menu Generator

GaleMenu is a simple menu generator for Python.

Installation

To install GaleMenu, run pip install galemenu.

To include it in your project, import it like so:

import galemenu

Use

Creating a menu

menu = galemenu.menu(name, [border], [prompt], [text], [error])

name - the title of the menu

border - the underline of the title (optional - default =)

prompt - the characters shown before the input prompt (optional - default >)

text - the text shown before the prompt (optional - blank by default)

error - the message shown if an invalid menu choice made (optional - default Please choose an option from the menu.)

Adding options to menu

menu.additem(function, name, [parameters])

function - the function that the menu option points to

name - the display name of the menu option

parameters - an array of parameters to pass to the function (optional)

Displaying the menu

menu.start()

This will start the menu and display it at the point when it is

Example

import galemenu

def coolFunction(text):
    print(text)

menu = galemenu.menu("The best menu")
menu.addItem(coolFunction, "Item number 1", ["hey"])
menu.addItem(coolFunction, "Item number 2", ["hey2"])

menu.start()

This menu, called "The best menu", has 2 options - Item number 1 and Item number 2. They each pass a single parameter to the function coolFunction.

this is where the picture of the menu is supposed to be

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

GaleMenu-1.1.2-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file GaleMenu-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: GaleMenu-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.6.4

File hashes

Hashes for GaleMenu-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8065d2387d9587675c863a74553789868b51dcf1c463a69d77bc1a6b8fa4a35d
MD5 a24324e62310749495958e6a377d80e3
BLAKE2b-256 b197cf680b548ba6cb7a35b548f693dae0aa690d513c334d226946246f83ab94

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