PyChoices
A very small Python library for receiving choice input from your user.
Installing
pip3 install pychoices
Quickstart
import pychoices
result = pychoices.ask("Squirtle", "Charmander", "Bulbasaur", label="Choose your Starter!")
print(result)
#(0, "Squirtle") or (1, "Charmander") or (2, "Bulbasaur")
What It Does
PyChoices will clean the terminal and display the options provided in the args.
The user can change the answer by using the up and down arrows.
Then, by pressing enter, the option will be defined as selected and the function will finish by returning a tuple.
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
Metadata
Release files for pychoices 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pychoices-0.0.3.tar.gz | 3.0 kB | Without provenance | Details for pychoices-0.0.3.tar.gz |
Release files / pychoices-0.0.3.tar.gz
| Download URL | pychoices-0.0.3.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0e08dc6facf98aad879d05cf10084460e99964c77d8cabcf467b059da78281a2
|
|
BLAKE2b-256 checksum How to use checksums |
99b500e9f8e78db353fa867e9fc26ae13bfb82c2c7a478861833eb2a3afc911a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8
|
Security for pychoices 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.