Skip to main content

An easy text-menu creation interface

Project description

pytnu

An easy interface to create text-menus with

About The Project

pytnu is a lightweight, easy to use menu creation interface that allows you to create easy text-based menus. It supports nested menus and allows the user to easily build a user interface;

(back to top)

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

Prerequisites

This package uses no prerequisites and no external packages are necessary.

Installation

  1. Install the package using pip
    pip install pytnu
    

(back to top)

Usage

enter image description here

  1. Import pytnu

  2. Create a dictionary with your options and descriptions options = {name: (description, functionName)} Name is the keyword the user inputs to call the option Description is the text that tells the user what the option does functionName is the name of the function to be called, without the parenthesis.

  3. Create a Menu object using Menu(options)

  4. To start the menu, use Menu.start()

To re-create the menu seen above:

options = {"opt1": ("Prints Foo", printFoo), "opt2": ("Prints Bar", printBar)}
menu = Menu(options)
menu.start()

(back to top)

Methods

Menu.addOption(name, description, funcName)

Adds an option to the available options of a menu class

Menu.delOption(name)

Deletes an option based on the given name

(back to top)

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

pytnu-1.0.1.tar.gz (2.8 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