Module for colorful printing and error handling.
Project description
Module for colorful printing and error handling.
pip install exceptdrucker
Tested against Windows 10 / Python 3.11 / Anaconda
Module for colorful printing and error handling.
Handle and display errors in a customizable format.
Args:
*args: Variable length argument list.
**kwargs: Arbitrary keyword arguments.
debug (bool): Indicates whether debugging is enabled. Defaults to True.
symbol_top (str): Symbol to print at the top of the error message. Defaults to "╦".
symbol_bottom (str): Symbol to print at the bottom of the error message. Defaults to "╩".
len_top (str): Length of the top symbol line. Defaults to "60".
len_bottom (str): Length of the bottom symbol line. Defaults to "60".
color_top (str): Color of the top symbol line. Defaults to "YELLOW_DARK".
color_bottom (str): Color of the bottom symbol line. Defaults to "RED_DARK".
print_to_stderr (bool): Whether to print to stderr. Defaults to False.
color_exception (str): Color of the exception message. Defaults to "CYAN".
Example:
from exceptdrucker import errwrite, config
try:
print("hello" / 2)
except Exception:
errwrite()
try:
print("hello" / 2)
except Exception:
errwrite(
debug=True,
symbol_top="V",
symbol_bottom="A",
len_top="40",
len_bottom="40",
color_top="YELLOW",
color_bottom="RED",
choosen_color="BLUE",
print_to_stderr=False,
color_exception="WHITE",
)
try:
print("hello" / 2)
except Exception:
errwrite(
debug=False,
)
config.debug = False
try:
print("hello" / 2)
except Exception:
print("nothing")
errwrite()
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
exceptdrucker-0.10.tar.gz
(4.3 kB
view hashes)
Built Distribution
Close
Hashes for exceptdrucker-0.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 472d86fc4352498100d12d47cb4a3a4a3c256e4548eaa950e1a3de6a8d7f1740 |
|
MD5 | 3b3d1b1cdfe7a84189f4644f4f5b5aa9 |
|
BLAKE2b-256 | e157a6895761f3f2d81af5003080ca5227f16b4e2d0cf27b3ddb215a0f56a35a |