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 breakpoint
  • c: continue debugging until hit breakpoint
  • s: step through code
  • n: go next line of code
  • l: list source code current file (default: 11 lines including line being executed)
  • u: navigate stack frame
  • d: navigate down stack frame
  • p: print value of expression in current context

if don't want use command line debugger, ides pydev have gui debugger.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -