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 details)
Built Distribution
File details
Details for the file exceptdrucker-0.10.tar.gz
.
File metadata
- Download URL: exceptdrucker-0.10.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb817acc109ec654f7a8a863adaaa83452fbb7cd6cae8436d8af779924025416 |
|
MD5 | d20796b28f08f91143644219c4184f8d |
|
BLAKE2b-256 | a4a22a7ef51fa4f560545387175c52394324119a615f75a79edc94ab65ee6e6c |
File details
Details for the file exceptdrucker-0.10-py3-none-any.whl
.
File metadata
- Download URL: exceptdrucker-0.10-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 472d86fc4352498100d12d47cb4a3a4a3c256e4548eaa950e1a3de6a8d7f1740 |
|
MD5 | 3b3d1b1cdfe7a84189f4644f4f5b5aa9 |
|
BLAKE2b-256 | e157a6895761f3f2d81af5003080ca5227f16b4e2d0cf27b3ddb215a0f56a35a |