Help wanted in piping in Windows

Thomas Guettler guettli at thomas-guettler.de
Fri Jun 24 06:56:33 EDT 2005


Am Fri, 24 Jun 2005 01:28:38 +0530 schrieb Apple Grew:

> I want to develope a Winboard like application which will support 
> Winboard protocol. For that I require to know how to handle piping in 
> Python. I seperated out module popen2, but when I use 
> fileObject.readline() then it halts the program if the sub-process is 
> waiting for user input; will executing the readline() part in a seperate 
> thread be helpful? My target platform is Windows.
> 
> Links to helpful web resources and sample Python codes will be highly 
> appreciated.

Piping on Windows is not much different than on Unix. You
should only have *one* open file descriptor. If the subprocess
needs to read from stdin, then stdout and stderr should be
redirected to a file. Otherwise you can get deadlocks, because
the buffers have a finit size.

AFAIK ">file" and "2>file" does work on windows.

On Unix you can the module "select".

 HTH,
  Thomas

-- 
Thomas Güttler, http://www.thomas-guettler.de/





More information about the Python-list mailing list