14
Jul
09

awesome python alternative to pdb



I hope you know about ipython. It’s a very cool Python interactive shell, with colored output and tab completion ( among other features ). I use it all the time.

For my debugging needs, I’m using pdb. I think most Python coders do this too.

Today, I was thinking how cool it would be if I could drop into ipython instead of pdb, so I asked on stackoverflow.
Here’s a link to the question : SO link.

All you have to do is install the ipdb gem. You can do this using easy_install, like this :


easy_install ipdb

and then you use it in your code, like this :


import ipdb

... some code here
ipdb.set_trace()
... rest of the code

A small tip: if your ipdb shell isn’t coloured, make sure you install the pyreadline library.

Advertisements

1 Response to “awesome python alternative to pdb”



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Blog Stats

  • 221,399 hits

%d bloggers like this: