Minimalistic python module to print colorful messages
Project description
error-helper
This is a minimalistic python module which helps you print colorful messages for CLI tools. It's available on PyPi, but you can also add it to your project as a git submodule.
Usage
>>> from error_helper import *
>>> info("this is information") # output will be blue
this is information
>>> hint("this is less important information") # output will be grayed out
this is less important information
>>> warning("something didn't go quite right...") # output will be yellow
warning: something didn't go quite right...
>>> error("something went terribly wrong") # output will be red
error: something went terribly wrong
>>> success("completed the operation!") # output will be green
successfully completed the operation!
prompt(...)
and prompt_input(...)
The prompt(...)
function, by default, prints a newline, followed by the provided values,
a colon and another newline:
>>> prompt("enter the server url")
enter the server url:
>>>
The prompt_input(...)
function, by default, prints the provided values, followed by a colon
and a space. Then it calls the default input(...)
function and returns it's result. The result
will be stripped if strip=True
(default).
>>> prompt("enter the server url"); url = prompt_input("url:")
enter the server url:
url: https://30350n.de
>>> url
'https://30350n.de'
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
error_helper-1.1.tar.gz
(2.8 kB
view hashes)
Built Distribution
Close
Hashes for error_helper-1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3de743b53456f959d79d2bd46d2e2d26899e90a675aba44ceef2da420118ad01 |
|
MD5 | 52b91e347e08c8dfbbd3fd82432a4ec3 |
|
BLAKE2b-256 | 427bb01f50d07b4013b7519a32e1f491940fc6fced952a58395f6ff4f3889295 |