Can you step through python code to help debug issues? -
in java/c# can step through code trace might going wrong, , ide's make process user friendly.
can trace through python code in similiar fashion?
yes! there's python debugger called pdb
doing that!
you can launch python program through pdb
using pdb myscript.py
or python -m pdb myscript.py
.
there few commands can issue, documented on pdb
page.
some useful ones remember are:
b
: set breakpointc
: continue debugging until hit breakpoints
: step through coden
: go next line of codel
: list source code current file (default: 11 lines including line being executed)u
: navigate stack framed
: navigate down stack framep
: print value of expression in current context
if don't want use command line debugger, ides pydev have gui debugger.
Comments
Post a Comment