[IPython-dev] !commands in the zmq model

Fernando Perez fperez.net at gmail.com
Thu Sep 2 16:58:07 EDT 2010


On Thu, Sep 2, 2010 at 1:43 PM, Gael Varoquaux
<gael.varoquaux at normalesup.org> wrote:
> Puzzling! I tried that old piece of crappy code that I wrote, and was
> very surprised to find that it still runs. I can run '!pdflatex' and get
> immediate interaction with the spawned program (I remember that achieving
> this was hard), however I can also confirm that when I spawn a Python
> process, things don't go well (try simply '!python'): synchronous display
> doesn't work.
>
> I have no clue why this is the case, and it's certainly not worth wasting
> time investigating this if you have a better option (and it looks like
> you do).

It's worth pointing out that we will lose one thing from a
terminal-based setup: the ability to *interact* with subprocesses.
The moment you get the network involved in all of this, transporting
reliably both the stdin of the kernel *and* of subprocesses with
different file descriptors is more or less impossible.

But that's OK: I'd rather have reliable async communication and subp
killing than interaction; after all, we're not making a raw shell.
People can always open a separate terminal for 100% pure shell work.

And if later, someone comes along and improves things to also get
stdin to work, that would be fabulous, but I'm not holding my breath
given what I know about how pexpect works.  Basically pexpect now
holds control of the subprocess, and we can send whatever we want, but
I think only in response to text patterns or a timeout event.  But I
don't know how to make pexpect fire a callback if read() is called on
the stdin file descriptor of the subprocess, which is what we'd need.

> Thanks for your (collective 'your') efforts on IPython. It is really
> starting to look good in terms of providing the basis for a scientific
> IDE.

It's been a lot of fun, and I think we're going to have something very
cool, and for potential for pretty amazing ideas to be implemented,
quite soon.

Regards,

f



More information about the IPython-dev mailing list