Stop and go - two Python(Win) questions

Fernando Pérez fperez528 at yahoo.com
Tue Jan 15 06:54:16 EST 2002


Martin Bless wrote:

> (2) Is there a way to include a stable and static breakpoint in Python
> SOURCE while debugging, something like a "suspend" command, that make
> introspection and a resume possible?
> 
> Martin

Take a look at my IPython project: http://www-hep.colorado.edu/~fperez/ipython

It gives you a ready to embed interpreter. You can simply go as follows:

... your code...
IPython.embed() -> code stops and opens an interpreter which sees the state 
of your code. You can see variables, print, etc. All your vars and functions 
are available. When done, hit Ctrl-D as usual to terminate.
... your code continues.

You could put the embed() calls in an 

if DEBUG:

and globally turn them on/off easily.

hth,

f.



More information about the Python-list mailing list