[IPython-user] Fwd: debugging a function w/ipython

belinda thom bthom at cs.hmc.edu
Thu Jan 11 21:05:32 CST 2007


I quick question...

Begin forwarded message:

> This does /not/ satisfy your constraint of not having to modify your
> code, but hopefully the modification is minimal: one line at the top
> of your module and a single call where you want to open the debugger.

Is there a way to structure code so that _if_ I'm using IPython the  
one-line-at-top import gets called, and if I'm just using Python it  
gets ignored?

The reason I ask is that its sometimes easier to use python (e.g.  
currently I do doctests that way, although if I have time, I'll  
consider IRunner) than IPython.

I'd like to be able to put this import in just about every file I'm  
likely to write, and then if I forget to comment it out, it won't run  
in python anymore.



More information about the IPython-user mailing list