[IPython-User] %loadpy after %edit close?

Matthias BUSSONNIER bussonniermatthias@gmail....
Thu Mar 1 09:26:38 CST 2012


Le 1 mars 2012 à 14:54, reckoner a écrit :

> 
>     Hi,
> 
>     I mainly use ipython with the qtconsole and I would like to have the
>     contents of the %edit command automatically %loadpy-ed into the 
> ipython
>     window when I close the editor.
Hi,  

I guess the reason why it is not really possible (to execute or  loadpy after edit)  is that with the qtconsole
you don't have any reasonable way to be certain of when the edition is done, 
by opposition of the terminal python where the program returns when the edition  is done.

Otherwise, I think the %edit magic for the Qtconsole is here :
IPython/frontend/qt/console/ipython_widget.py
L 411 def _edit(self, filename, line=None):

and the core edit magic in smith like 
IPython/core/magic.py 

magic_edit function

you can still try to add a flag and open a PR on github.

have fun. 
-- 
Matthias


> I realize this is outside of the scope
>     of the intent of the %edit command, but if you could point me to the
>     relevant bits of code, I will try to hack this for myself.
> 
>     Thanks again for all the great work!
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user



More information about the IPython-User mailing list