Mark Wooding <[EMAIL PROTECTED]> wrote:
>  Nick Craig-Wood <[EMAIL PROTECTED]> wrote:
> > Harishankar <[EMAIL PROTECTED]> wrote:
> >>  1. Create non-blocking pipes which can be read in a separate thread
> >>  [...]
> >
> > You are correct on both of those points.
> 
>  I must be missing something.  What's wrong with spawning the subprocess
>  with subprocess.Popen as usual, passing subprocess.PIPE as stdin/stdout/
>  whatever, making your end nonblocking with fcntl.fcntl and then using
>  os.read/os.write in the obvious ways?

Nothing apart from the fact it doesn't work on windows.  The buffering
will cause you grief too.  If you want to do this properly under unix
use pexpect not subprocess.

  http://www.noah.org/wiki/Pexpect

Proper non blocking IO is an absolute nightmare under Windows in my
experience!  It really isn't the Windows way so you are fighting the
system the whole time.

-- 
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to