Python debugging tips using pdb.

import pdb

pdb.set_trace() => set Breakpoint

pdb>
n => next
c => Continue
p => print
l => list last 11 lines of code
function operations
s => next line (same as n, but it steps in into function)
r => step thru till end of function and continue from next level
var= value => user can assign value at any point.
q => quit

Advertisements
Post a comment or leave a trackback: Trackback URL.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: