[IPython-User] modify a running script

MinRK benjaminrk@gmail....
Fri Sep 23 13:46:20 CDT 2011


On Thu, Sep 22, 2011 at 10:38, Piotr Zolnierczuk <
piotr.zolnierczuk@gmail.com> wrote:

> Hi,
>
> I came across this an interesting new use case.
>
> A user wants to run a (long running experiment control) script and pause it
> at some point, modify something (e.g. a variable) and continue the
> execution.
>
> My answer was to use pdb from within ipython. Is there (out there) anything
> else that could be used for this?
>

An alternative to pdb (but similar, in that it involves setting breakpoints
beforehand), is to stick IPython.embed() calls, to drop into an IPython
shell with the local namespace.  You can use Paul's idea of a sigint handler
to activate a switch, if you only want to drop into IPython sometimes.


> Piotr
>
> --
>
> Piotr Adam Zolnierczuk
> e-mail: piotr@zolnierczuk.net
> www:   http://www.zolnierczuk.net
> _____________________________________
> written on recycled electrons
>
>
>
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20110923/c6ca2ffd/attachment.html 


More information about the IPython-User mailing list