[IPython-User] modify a running script

MinRK benjaminrk@gmail....
Fri Sep 23 15:01:45 CDT 2011


On Fri, Sep 23, 2011 at 12:48, Piotr Zolnierczuk <
piotr.zolnierczuk@gmail.com> wrote:

> I am already running IPython (0.11) - the method you described only works
> for "regular" python, right?


Ah, yes.  If you are running a script from inside IPython, and then call
IPython.embed() from inside that script can cause things to explode.

-MinRK


>
>
>
> On Fri, Sep 23, 2011 at 2:46 PM, MinRK <benjaminrk@gmail.com> wrote:
>
>>
>>
>> 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
>>>
>>>
>>
>
>
> --
>
> Piotr Adam Zolnierczuk
> e-mail: piotr@zolnierczuk.net
> www:   http://www.zolnierczuk.net
> _____________________________________
> written on recycled electrons
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20110923/c728403a/attachment.html 


More information about the IPython-User mailing list