Skip to main content

pdbp (Pdb+): A drop-in replacement for pdb and pdbpp.

Project description

pdbp (Pdb+)

Pdb+ Advanced Python Console Debugger

pdbp (Pdb+) is an advanced console debugger for Python. It can be used as a drop-in replacement for pdb and pdbpp.

pdbp (Pdb+) makes Python debugging a lot easier (and more fun!)


Pdb+

Installation & Usage:

pip install pdbp

Then add import pdbp to an __init__.py of your project, which will automatically make Pdb+ the default debugger at breakpoints:

import pdbp

(If using flake8 for code-linting, you may want to add # noqa to that line):

import pdbp  # noqa

To trigger a breakpoint in your code with pytest, add --trace (to start tests with a breakpoint) or --pdb (to trigger a breakpoint if a test fails).

Basic Pdb+ console commands: n, c, s => next, continue, step.

(To learn more Pdb+ console commands, type help in the Pdb+ console and press Enter/Return.)


pdbp (Pdb+) makes improvements to pdbpp so that it works in all environments. It also includes other bug-fixes. "Sticky" mode is the default option, which shows multiple lines of code while letting you see where you're going (while typing n + Enter).

If you somehow reset pdb to Python's built-in version, you can always replace pdb with pdbp again as the default debugger by running this:

import pdb
import pdbp
for key in pdbp.__dict__.keys():
    pdb.__dict__[key] = pdbp.__dict__[key]

Here's how to customize pdbp/pdb options if you don't like the default settings: (Shown below are the default settings.)

import pdb
if hasattr(pdb, "DefaultConfig"):
    pdb.DefaultConfig.filename_color = pdb.Color.blue
    pdb.DefaultConfig.line_number_color = pdb.Color.turquoise
    pdb.DefaultConfig.show_hidden_frames_count = False
    pdb.DefaultConfig.disable_pytest_capturing = True
    pdb.DefaultConfig.enable_hidden_frames = False
    pdb.DefaultConfig.truncate_long_lines = True
    pdb.DefaultConfig.sticky_by_default = True

You can also trigger Pdb+ activation like this:

import pdbp
pdbp.set_trace()

pdbp (Pdb+) commands:

Pdb+ Commands

Sticky Mode vs Non-Sticky Mode:

The default mode (sticky) lets you see a lot more lines of code from the debugger when active. In Non-Sticky mode, only one line of code is shown at a time. You can switch between the two modes by typing sticky in the Pdb+ console prompt and pressing Enter/Return.

Sticky Mode:

Pdb+ Stick Mode

Non-Sticky Mode:

Pdb+ Non-Sticky Mode

More examples:

Pdb+ is used by packages such as seleniumbase:


Pdb+ Advanced Python Console Debugger
Pdb+

(Pdb+ is maintained by the SeleniumBase Dev Team)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pdbp-1.2.6.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pdbp-1.2.6-py2.py3-none-any.whl (15.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pdbp-1.2.6.tar.gz.

File metadata

  • Download URL: pdbp-1.2.6.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for pdbp-1.2.6.tar.gz
Algorithm Hash digest
SHA256 b6603037e4bc37af931f861b61d5a37c99082f8ef2aa60ba9476ab4de524be2d
MD5 ec655dfab9316ff6638e6764ff49c485
BLAKE2b-256 07545d9bab42af216c24c724b30c3c2d8ee15b613622180de0d2a68ffa5e83d6

See more details on using hashes here.

File details

Details for the file pdbp-1.2.6-py2.py3-none-any.whl.

File metadata

  • Download URL: pdbp-1.2.6-py2.py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for pdbp-1.2.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 146e6147aff3ca564d9436081f0165109ea32e77a1726d468fcc723b0730ca1b
MD5 fc7d158135669657d17e1ec601bd1b12
BLAKE2b-256 9d859d961cae93c646a5b6e093db8953ae1d0266f7c30067c35ae11e4819b431

See more details on using hashes here.

Supported by

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