The pdb module defines an interactive source code debugger for Python programs. Below are frequently used commands:
# Run pdb when this line is hitimportpdb;pdb.set_trace()# Run pdb when the script is runpython-mpdbscript.py# Helph[elp]# Show current contentl[ist]# Examine variablesp[rint]# Pretty printpp# Go to next linen[ext]# Step intos[tep]# Continue execution until the line with the line number greater # than the current one is reached or when returning from current frame.until# Returnr[eturn]# See all breakpointsbtoseeallbreakpoints# Set breakpoint at line 16b16# Clear breakpoint 1cl[ear]1# Continuec[ontinue]# Conditional breakpoints, line 11b11,this_year==2015# Stack locationw[here]# Go up in stacku[p]# Go down in stackd[own]# Longlist shows full method of where you're in (Python 3)ll# Quitq[uit]
File "<ipython-input-1-300bfa7c669b>", line 5 python -m pdb script.py ^ SyntaxError: invalid syntax