Pragmatic Paddy

November 17, 2008

python debug mode in emacs

Filed under: Uncategorized — Paddy Mullen @ 7:37 am

I was walking through some SQLAlchemy code last week and I used pdb, the python debugger for the first time.  It was a truly astonishing experience.  I have seen debuggers before, primarily in javascript and java , and they were helpful, and relatively easy to get started with, but there were annoyances there that I couldn’t easily correct.  Not so with pdb.

First with pdb, you seem to have all of the power of python available at your fingertips.

Second, pdb is all text, no need to use a mouse.

Third, pdb integrates with emacs very well.

Even with ropemacs, emacs is somewhat lacking for python integration, I’m getting more used to it, but it feels clunky (emacs freezes if you try to execute long running code and your not already running a shell).  pdb integration rocks though,  buffers for the appropriate files open as you step into functions, showing you  line number with a caret on the left hand side of the screen.

Next up (abbrev-mode) abbreviations for pdb-mode.  when stepping through the debugger, it is annoying to press “s RETURN”,  I think I will make an an abbreviaton tying “s” to “s RETURN” , just for pdb mode.

2 Comments »

  1. Have you gotten pdb to integrate with emacs under windows? I can’t seem to make this work.

    Comment by doug — April 7, 2009 @ 3:29 pm

  2. Yes I did get it to work. I also got pymacs and ropemacs to work. I forgot exactly what I did, but it wasn’t anything extraordinary.

    Comment by Paddy Mullen — May 5, 2009 @ 1:27 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress