Small Python library for receiving choice input from user.
Project description
PyChoices
A very small Python library for receiving choice input from your user.
Installing
pip3 install pychoices
Quickstart
import pychoices
result = pychoices.ask("Pizza", "Hamburguer", "Fries", label="Choose your favorite food!")
print(result)
#(0, "Pizza") or (1, "Hamburguer") or (2, "Fries")
Reference
function ask(*args, **kwargs)
args is the array of choices available for the user. kwargs is a dictionary of options for customizing the ask function, the available options are:
- label: a string that will be printed along with the choices
- color: one of the options in the COLORS class, will be the color of the current activated option.
class Colors
Class holding some constant values of colors and styles for using in the ask function, the available colors are:
- HEADER: Purple
- OKBLUE: Blue
- OKGREEN: Green
- WARNING: Yellow
- FAIL: Red
- BOLD: Bold
- UNDERLINE: Underlined
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.
Source Distribution
pychoices-0.0.2.tar.gz
(2.4 kB
view hashes)