Esmail wrote:
Hi all,

What is your favorite tool to help you debug your
code? I've been getting along with 'print' statements
but that is getting old and somewhat cumbersome.

I'm primarily interested in utilities for Linux (but
if you have recommendations for Windows, I'll take
them too :)

I use emacs as my primary development environment, FWIW.
Someone mentioned winpdb .. anyone have experience/comments
on this? Others?

Thanks,
Esmail

I execute the program within IPython.
>>> run test.py

I usually write a CTRL+C except clause that will spawn an Ipython shell so I can inspect the namespace at that time.
I'm also using the ipdb to spawn the debugger.

import IPython
ipdb = IPython.Debugger.Pdb(color_scheme='Linux')
ipdb.set_trace()

it spawns the IPython debugger, allowing step by step execution, code inspection, changing the namespace. You get all the IPython benefits (espacially the TAB completion, history ...)

I used to proceed with print statements, but they are some situations where it won't just make it. Sometimes the code is so complex you can't anticipate all the required prints to catch a bug.

JM
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to