[IPython-User] notebook magic development questions

Matthias BUSSONNIER bussonniermatthias@gmail....
Mon Jan 21 08:48:28 CST 2013


Le 21 janv. 2013 à 14:12, Ben Mabey a écrit :

> On 1/20/13 11:16 PM, Matthias BUSSONNIER wrote:
>> Le 21 janv. 2013 à 06:54, Ben Mabey a écrit :

>> Hi,
>> 
>> have you try adding an unload capability ?
>> http://ipython.org/ipython-doc/dev/config/extensions/index.html#writing-extensions
>> 
>> There might be some case where you can't unload, but at least you should only have to
>> restart the current kernel and not the server (from the notebook menu).
> 
> For simple extensions do I need to unregister the magic to allow for 
> reloading of the code?
> This is my simple magic so far dealing with ODBC DB connections:
> 
> https://gist.github.com/4585890
> 
> In my notebook I am using "%load_ext autoreload" and "%autoreload 2" but 
> changes to the extension don't take effect until after I restart the 
> kernel.  I have tried reevaluating "%load_ext sqlmagic" but that doesn't 
> help either.  Does the extension need to be placed in a certain dir to 
> allow for autoreloading?

This is not the part of the code where I'm comfortable with, 
but I'm not sure auto reload is made to auto reload magic, but more to reload
normal modules. 

and IIRC, %load_ext does track wether an extension has been loaded and avoid 
loading it if it has not been unloaded. 
Can you try if %reload_ext  works ?

Also, you are welcome to add your extension to 
https://github.com/ipython/ipython/wiki/Extensions-Index

if you wish.
-- 
Matthias



> 
> Thanks,
> Ben
> _______________________________________________
> 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/20130121/516728e2/attachment.html 


More information about the IPython-User mailing list