[IPython-User] Invoking ipython shell in the middle of script run and using magic commands

Joon Ro joonpyro@gmail....
Sun Apr 8 15:09:51 CDT 2012


On Sun, 08 Apr 2012 14:09:03 -0500, MinRK <benjaminrk@gmail.com> wrote:

> That's precisely what IPython.embed() is for.  What doesn't it do that  
> you
> want it to?
>
> -MinRK
>
> On Sun, Apr 8, 2012 at 12:03, Joon Ro <joonpyro@gmail.com> wrote:

Thanks. I was just not sure if I was doing it right. :)

One thing is though, after I run %timeit a function which uses  
weave.inline (the following code -> self.c_loglogit is just a c code to  
calculate multinomial logit likelihood) to compile inline c-code in the  
embeded ipython,
I cannot exit from the ipython console. After I give exit another ipython  
console comes right up.


     from scipy.weave import inline
     from scipy.weave import converters

     %timeit inline(self.c_loglogit,['log_p_new', 'X', 'betas_cand',  
'ncons', 'consnobs', 'consfirstindx', 'maskindx', 'nx', 'na'],  
type_converters=converters.blitz, force=0, verbose=1)

-Joon



More information about the IPython-User mailing list