A python package for UNIX terminal utilities
Project description
terminal-utils
A python package for UNIX terminal utilities
Menu
Getting started
Installation
With public pip repository
pip install ers-terminal-utils
Uninstallation
pip uninstall ers-terminal-utils
Usage
Dynamic choices via terminal
Mode: one choice (Source Code)
from terminal_utils.choices_via_terminal import ChoicesViaTerminal
LIST_OF_CHOICES = [
'Option 1',
'Option 2',
'Option 3',
'Option 4',
'Option 5'
]
TITTLE = 'Choose an option'
response = ChoicesViaTerminal(TITTLE, LIST_OF_CHOICES).main()
chosen_option_index, chosen_option_text = response[0]
print()
print('Chosen option index: {}\n'
'Chosen option text: {}'.format(chosen_option_index, chosen_option_text))
Mode: Multiple choices (Source Code)
from terminal_utils.choices_via_terminal import ChoicesViaTerminal
LIST_OF_CHOICES = [
'Option 1',
'Option 2',
'Option 3',
'Option 4',
'Option 5'
]
TITTLE = 'Choose one or more options'
response = ChoicesViaTerminal(TITTLE, LIST_OF_CHOICES,
mode='multiple_choices').main()
print('')
for chosen_option_index, chosen_option_text in response:
print(
'- Chosen option index: {}|Chosen option text: {}'.format(chosen_option_index,
chosen_option_text)
)
LICENSE
This project is licensed under the MIT License - see the LICENSE page for details.
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
Built Distribution
Close
Hashes for ers_terminal_utils-0.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8610e5f437c41bed38d931b98a55e821b5ee2e6f4dc5ee3b9ea3f4ffb0dcf86d |
|
MD5 | 18a09db415951764ffc4c1273ee15a92 |
|
BLAKE2b-256 | e7035619469258f2fd71d97c699a8df013d1d713e647187109449776d57a83a3 |