[IPython-user] running code while an editor is still open?

Fernando Perez Fernando.Perez at colorado.edu
Wed Mar 15 12:15:17 CST 2006


Ville Vainio wrote:
> On 3/15/06, John Salerno <johnjsal at rcn.com> wrote:
> 
>>Is there a way to run code you've type in your external editor (using the
>>edit alias) while the editor is still open?
> 
> 
> No, I don't think so, but we can add it.
> 
> "%edit -g" (g is for "go" - "-r" is already taken) could be added to
> run the previously %edited file.

I'm not sure we really need more options in %edit, which already has a complex 
doc page.  Especially since John's need can be solved with the existing tools: 
  you can simply save the file in the editor, switch to the ipython console, 
and just type

run your_filename

This will simply read the script from disk and execute it.  So what John wants 
can certainly be done today, as long as you he knows the name of the file 
(which may be an autogenerated temp file in some cases, but most editors let 
you see the path in some way).

Cheers,

f




More information about the IPython-user mailing list