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;
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
- Install the package using pip
pip install pytnu
Usage
-
Import pytnu
-
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. -
Create a Menu object using
Menu(options)
-
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()
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.