[IPython-User] modify a running script

Fernando Perez fperez.net@gmail....
Fri Sep 30 21:03:15 CDT 2011


On Thu, Sep 22, 2011 at 10:38 AM, Piotr Zolnierczuk
<piotr.zolnierczuk@gmail.com> wrote:
> 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?

Depending on what your environment/setup is, a good solution can be to
have a GUI with a button that interrupts the code and opens up an
ipython qconsole with the namespace you want to manipulate.  Here are
two examples where 'your application' is written in either WX or Qt:

https://github.com/ipython/ipython/blob/master/docs/examples/lib/ipkernel_qtapp.py
https://github.com/ipython/ipython/blob/master/docs/examples/lib/ipkernel_wxapp.py

they both use this small stub:

https://github.com/ipython/ipython/blob/master/docs/examples/lib/internal_ipkernel.py

Cheers,

f


More information about the IPython-User mailing list