Skip to main content

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


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)

Uploaded Source

Built Distribution

exceptdrucker-0.10-py3-none-any.whl (5.6 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