[IPython-User] %edit in qtconsole vs ipython
Tue Feb 21 14:34:30 CST 2012
Thomas Kluyver <takowl <at> gmail.com> writes:
> It's tricky to do well in a GUI environment. In the terminal, we
> assume that the editor command will block execution until the user
> closes it. But the command to launch a GUI editor may return
> immediately, and if the editor has multiple files open, closing it to
> run one file is impractical.
> As a compromise, you can use %save to get interactively entered code
> into a file, then %edit and %run to use it.
I can see what you're getting at if you're thinking in terms of a console
editor, taking over the terminal until it quits and returns to IPython, but this
actually works fine already with a GUI editor and IPython running in the
terminal. Using gvim with the -f option for foreground (or alternatives like
--remote-wait), TextMate with `mate -w` for wait, etc. and saving and closing
the window/buffer opened by ipython returns and executes as expected. Quitting
the editor completely, with other previously-opened files, isn't necessary.
Shouldn't it be possible to wait on a child process in qtconsole in the same way?
(Apologies for the double post).
More information about the IPython-User