Skip to main content

A simple package to add code highlighting to the python debugger (PDB).

Project description

PDB Color

Add some color to the python debugger.

Installation

Install with pip.

pip install pdbcolor

Setup

Python can be configured to use PDB Color by changing the PYTHONBREAKPOINT environment variable. To use PDB Color temporarily, add the PYTHONBREAKPOINT=pdbcolor.set_trace prefix before running your python script:

PYTHONBREAKPOINT=pdbcolor.set_trace python3 main.py

To make PDB Color the default for all Python sessions, set the PYTHONBREAKPOINT environment variable to pdbcolor.set_trace. On Mac and Linux, you can do this with the export command:

export PYTHONBREAKPOINT=pdbcolor.set_trace

Add this line to your terminal configuration file (e.g. .bashrc or .zshrc) to ensure the setting persists across terminal settings.

Usage

PDB Color is a drop-in replacement for PDB that simply adds color to PDB's outputs. See the PDB documentation for a PDB introduction.

PDB Color also has tab autocompletion by default which can be triggered using the TAB key. For example:

$ python3 main.py
> /home/alex/documents/pdbcolor/main.py(9)<module>()
-> y = 2
(Pdb) str.
str.capitalize(    str.isalpha(       str.ljust(         str.rpartition(
str.casefold(      str.isascii(       str.lower(         str.rsplit(
str.center(        str.isdecimal(     str.lstrip(        str.rstrip(
str.count(         str.isdigit(       str.maketrans(     str.split(
str.encode(        str.isidentifier(  str.mro()          str.splitlines(
str.endswith(      str.islower(       str.partition(     str.startswith(
str.expandtabs(    str.isnumeric(     str.removeprefix(  str.strip(
str.find(          str.isprintable(   str.removesuffix(  str.swapcase(
str.format(        str.isspace(       str.replace(       str.title(
str.format_map(    str.istitle(       str.rfind(         str.translate(
str.index(         str.isupper(       str.rindex(        str.upper(
str.isalnum(       str.join(          str.rjust(         str.zfill(
(Pdb) str.

Examples

Using PDB:

Code example using PDB

Using PDB Color:

Code example using PDB

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

pdbcolor-0.3.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

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

pdbcolor-0.3.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file pdbcolor-0.3.0.tar.gz.

File metadata

  • Download URL: pdbcolor-0.3.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pdbcolor-0.3.0.tar.gz
Algorithm Hash digest
SHA256 5237b941e5d437e5d0f13f5a811fde6567c50032d0679f8edceb67f1dadf2911
MD5 14146a1a2d8c5eea27138d793a35d4dc
BLAKE2b-256 7e79635d11595d78991076fc162219ad50201a469fb3aab5edd67b0cdcbcb3f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for pdbcolor-0.3.0.tar.gz:

Publisher: workflow.yml on Alex-JG3/pdbcolor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pdbcolor-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: pdbcolor-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pdbcolor-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fc4ec09842313641d26beb4a9fddee8b336371221e39a81ca6d36cb9236df5c5
MD5 fb5870081648ce8b8827ef2b99e7afff
BLAKE2b-256 2865c12afb99e2fae458d95b628ec74ae844977636e47cc68437f886057cfb6d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pdbcolor-0.3.0-py3-none-any.whl:

Publisher: workflow.yml on Alex-JG3/pdbcolor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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