[IPython-User] Invoking ipython shell in the middle of script run and using magic commands
Sun Apr 8 14:09:03 CDT 2012
That's precisely what IPython.embed() is for. What doesn't it do that you
want it to?
On Sun, Apr 8, 2012 at 12:03, Joon Ro <firstname.lastname@example.org> wrote:
> Basically what I want to do is stop the script during its run and invoke
> ipython shell,
> just like setting from ipdb import set_trace; set_trace().
> But also I want to use some magic commands, especially %timeit, in the
> shell, so I can
> check how a couple of different implementation of a function performs. I
> want to do it
> in the middle of a script run because there is a lot of overhead and I
> don't want to
> make another script just for the testing.
> I found putting the following into the code pretty much did what I want:
> from IPython import embed
> as this gives all the variables with their values and also I could use
> magic commands as well.
> I wonder if there is better way to do this or this is the right way?
> Thank you,
> IPython-User mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-User