Non-blocking pipes during subprocess handling

Nick Craig-Wood nick at craig-wood.com
Tue Jan 9 07:30:06 EST 2007


Tom Plunket <tomas at fancy.org> wrote:
>  I'm using subprocess to launch, well, sub-processes, but now I'm
>  stumbling due to blocking I/O.
> 
>  Is there a way for me to know that there's data on a pipe, and possibly
>  how much data is there so I can get it?

You might want to check out this modification to subprocess which does
non-blocking pipes.

  http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440554

I personally think something like that should be built into subprocess

-- 
Nick Craig-Wood <nick at craig-wood.com> -- http://www.craig-wood.com/nick



More information about the Python-list mailing list