LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

ipdb

IPython-enhanced Python debugger

TLDR

Start ipdb debugger
$ python -m ipdb [script.py]
copy
Set breakpoint in code
$ import ipdb; ipdb.set_trace()
copy
Post-mortem debugging
$ python -m ipdb -c continue [script.py]
copy
Run until exception
$ ipdb.pm()
copy

SYNOPSIS

python -m ipdb [options] script [args]

DESCRIPTION

ipdb is the IPython-enhanced Python debugger. It provides the same interface as pdb but with syntax highlighting, tab completion, and better introspection from IPython.ipdb makes Python debugging more interactive and user-friendly, especially for exploring variables and understanding program state.

PARAMETERS

-c command

Execute command on start.
script
Python script to debug.

DEBUGGER COMMANDS

$ n (next)      Execute next line
s (step)      Step into function
c (continue)  Continue execution
r (return)    Return from function
l (list)      List source code
p expr        Print expression
pp expr       Pretty-print expression
b line        Set breakpoint
cl            Clear breakpoints
q (quit)      Quit debugger
h (help)      Show help
copy

USAGE IN CODE

$ import ipdb

def problematic_function():
    x = calculate_something()
    ipdb.set_trace()  # Debugger starts here
    return process(x)
copy

CAVEATS

Requires ipython package. Breakpoints pause execution. Don't leave settrace() in production code. Use breakpoint() in Python 3.7+ with PYTHONBREAKPOINT=ipdb.settrace.

HISTORY

ipdb was created as a drop-in replacement for pdb that leverages IPython's features. It provides the familiar pdb interface with enhanced usability.

SEE ALSO

ipython(1), pudb(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid