Skip to main content

Pdb with Rich library.

Project description

pdbr

PyPI version Python Version

Rich is a great library for terminal output. In order to make the PDB results more colorful.

Installing

Install with pip or your favorite PyPi package manager.

pip install pdbr

Breakpoint

In order to use breakpoint(), set PYTHONBREAKPOINT with "pdbr.set_trace"

import os

os.environ["PYTHONBREAKPOINT"] = "pdbr.set_trace"

or just import pdbr

import pdbr

New commands

vars(v)

it is used to get the local variables list.

Config

Style

In order to use Rich's traceback, style, and theme, set setup.cfg.

[pdbr]
style = yellow
use_traceback = True
theme = friendly

History

store_history setting is used to keep and reload history, even the prompt is closed and opened again.

[pdbr]
...
store_history=.pdbr_history

Vscode user snippet

To create or edit your own snippets, select User Snippets under File > Preferences (Code > Preferences on macOS), and then select python.json. Place the below snippet in json file.

{
  ...
  "pdbr": {
        "prefix": "pdbr",
        "body": "import pdbr; pdbr.set_trace()",
        "description": "Code snippet for pdbr debug"
    },
}

Samples

Traceback

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

pdbr-0.3.0.tar.gz (4.9 kB view hashes)

Uploaded Source

Built Distribution

pdbr-0.3.0-py3-none-any.whl (5.3 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