Python Debugger Cheatsheet Getting started


import pdb;pdb.set_trace() start pdb from within a script

repeat the last command

python -m pdb


execute the current statement (step over)


execute and step into function


continue execution until the current function returns


continue execution until a breakpoint is encountered


move one level up in the stack trace


move one level down in the stack trace

start pdb from the commandline

Basics h(elp)

print available commands

h(elp) command print help about command q(quit)

quit debugger

Examine p(rint) expr

print the value of expr

pp expr

pretty-print the value of expr

w(here) l(ist)

Breakpoints b(reak)

show all breakpoints with its number

print current position (including stack trace)

b(reak) lineno

set a breakpoint at lineno

list 11 lines of code around the current line

b(reak) lineno, cond stop at breakpoint lineno if Python condition cond holds, e.g. i==42

l(ist) first, last list from first to last line number a(rgs)

print the args of the current function

Miscellaneous !stmt alias map stmt

b(reak) file:lineno

set a breakpoint in file at lineno

b(reak) func

set a breakpoint at the first line of a func

tbreak lineno

set a temporary breakpoint at lineno, i.e. is removed when first hit

treat stmt as a Python statement instead of a pdb disable number command

disable breakpoint number

enable number

enable breakpoint number

clear number

delete breakpoint number

map Python statement as a map command

alias map stmt pass arguments to Python statement. stmt includes %1, %2, . . . literals. Save pdb commands to local <./.pdbrc> file for repetitive access.

Author: Florian Preinstorfer ([email protected]) — version 1.1 — license cc-by-nc-sa 3.0 See for more information.

Python Debugger Cheatsheet

Author: Florian Preinstorfer ([email protected]) — version 1.1 — license cc-by-nc-sa 3.0. See for more information.

171KB Sizes 2 Downloads 82 Views

Recommend Documents

The AndBug Debugger - GitHub
Many small tools wrapped by "Android" and Eclipse. Includes a ... or emulator. Key dependency of ANY Android debugger. ... AndBug is 90% Python, 10% C.

Debugger Detection.pdf
debugger must be present. If the return is erroneous, it's probably because we don't have a. debugger to output too. bool HasHardwareBreakpoints(). {. CONTEXT ctx = {0};. ctx.ContextFlags = CONTEXT_DEBUG_REGISTERS;. HANDLE hThread = GetCurrentThread(

There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Main menu.

would otherwise have special meaning in Markdown's formaing syntax. Markdown provides backslash escapes for. the following characters: \ backslash. ` backtick. * asterisk. _ underscore. {} curly braces. [] square brackets. () parentheses. # hash mark

TensorFlow Debugger: Debugging Dataflow Graphs for Machine ...
Debuggability is important in the development of machine-learning (ML) systems. Several widely-used ML libraries, such as TensorFlow and Theano, are based on ... Each node in the original graph is watched by a pair of nodes, a Copy (C).

Masters cheatsheet - top 80.pdf
Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Masters cheatsheet - top 80.pdf. Masters cheatsheet - top 80.pdf.

Doom Hammer. Dread Lance. Exorcist. Guru Staff. Heaven Hand. Hellion Crossbow. High Scabbard. Razorspikes. Revenant Bow. Rune Sword. Sacred Shield.

Grand Chain. Grand Halberd. Heaven Strand. Impellor. Kurastian Asp. Massacre Axe. Mythical Staff. Oni Blade. Pallium. Phantom Bow. Piercer. Ring. Sagaris. Sanctified. Quiver. Slag Hammer. Sovereign. Greaves. Sovereign Helm. Sovereign Mail. Sovereign.

Covers Python 3 and Python 2 - GitHub
You can add as much data as you want when making a ... chart.add('Squares', squares) .... Some built-in styles accept a custom color, then generate a theme.