Simple command line interface library
Project description
clinterface
clinterface is a simple command line interface library to display tab-completion prompts and interactive menus.
Quick start
Import the module
from clinterface import prompts
Create a default Selector instance
selector = prompts.Selector()
or create a customized Selector instance
selector = prompts.Selector(
shift = 1,
indent = 3,
align = 2,
margin = 1,
pad_left = 1,
pad_right = 1,
radiobullet = '*',
checkbullet = '+',
)
Set the options and defaults from a list
selector.set_options([
'Monday',
'Tuesday',
'Wednesday',
'Thursday',
'Friday',
'Saturday',
'Sunday',
])
selector.set_single_default('Friday')
selector.set_multiple_defaults(['Friday', 'Saturday', 'Sunday'])
or alternativey set the options and defaults from a dictionary
selector.set_options({
'Mon':'Monday',
'Tues':'Tuesday',
'Wed':'Wednesday',
'Thurs':'Thursday',
'Fri':'Friday',
'Sat':'Saturday',
'Sun':'Sunday',
})
selector.set_single_default('Fri')
selector.set_multiple_defaults(['Fri', 'Sat', 'Sun'])
Prompt for a single choice
selector.set_message('Choose the best day of the week:')
selector.single_choice()
Prompt for multiple choices
selector.set_message('Choose the good days of the week:')
selector.multiple_choices()
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file clinterface-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: clinterface-0.2.0-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.10.0 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.18 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc6e8cbc40879654a8c7eece9158e43113df341427180d07448ee059562234b8 |
|
MD5 | 5e66f7b41ea53e6e3aad65559a33cf85 |
|
BLAKE2b-256 | c5acb3e966ab21740157d0ec5b0e57c335f62396ea5a0a3bdcb354886409321e |