Python debugging and Textmate


I've never realized that among the many things Textmate does well there's also python debugging. Well, to be precise Textmate doesn't do much as it just relies on python's default debugger, called PDB. Ok, probably PDB isn't the cutting edge debugger you're looking for, but it's worth a try imho.

Nothing to install in order to try: just open up a python script with textmate, hit cmd+shift+D and a debug-terminal window will open. The essential commands for Pdb are (the first letter is the one to digit):

  • s(tep): Execute the current line, stop at the first possible occasion (either in a function that is called or on the next line in the current function).
  • r(eturn): Continue execution until the current subroutine returns.
  • n(ext): Continue execution until the next line in the current function is reached or it returns.
  • p(rint) expression: Evaluate the expression in the current context and print its value.
  • a(rgs): Print the argument list of the current function.
  • q(uit): Quit from the debugger
  • c(ont(inue)): Instead of quitting, Continue execution, only stop when a breakpoint is encountered.

A nice and clear crash course of Pbd can also be found here.

...

OTHER TEXTMATE TIPS AND TRICKS:

  • PdbTextMateSupport is a plugin that gives you a more powerful debugger within Textmate: a detailed description of its (simple) installation is here.
  • a nice post about 10 cool TextMate tips: most of them are HTML/CSS related, but worth checking out!
  • Textmate basic tutorial. This is a must for everyone who wants to use TextMate seriously (available also in Japanese!)
  • Three plugins that'll make textmate shine even more: Project Plus (adds extra functionalities to the project drawer), GetBundles (a better version of the old GetBundle), Ack In Project (a much faster 'search in project' function).
  • Nice screencast on how to use the Math bundle

...

Cite this blog post:


Michele Pasin. Python debugging and Textmate. Blog post on www.michelepasin.org. Published on Feb. 12, 2010.

Comments via Github:


See also: