Skip to main content

Minimalistic python module to print colorful messages

Project description

pypi python mit

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

This version

1.1

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)

Uploaded Source

Built Distribution

error_helper-1.1-py3-none-any.whl (3.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page