Need feedback on subprocess-using function

Nobody nobody at nowhere.com
Tue Oct 6 23:27:33 EDT 2009


On Mon, 05 Oct 2009 02:29:38 -0700, ryles wrote:

>> If you want a "double-ended" slave process, you need to use polling or
>> non-blocking I/O or asynchronous I/O or multiple threads. I'm not aware of
>> any single solution which works on all platforms.
>>
>> The easiest way around this problem is to redirect stderr to a temporary
>> file and read in the file's contents in the close() method.
> 
> There is also Popen.communicate():

That doesn't help if you want to write data incrementally.

You could always lift the code from Popen._communicate(), which uses
threads for Windows and select() for POSIX.




More information about the Python-list mailing list