Broken pipe with os.popen3()

Thomas Guettler guettli.usenet at thomas-guettler.de
Tue Apr 10 10:01:29 EDT 2007


Christoph Krammer wrote:

> Hello everybody,
>
> I try to use an external OCR tool to convert some binary image data to
> text. The image is in one variable, the text should be converted to
> another. I use the following code:
>
>   (si, so, se) = os.popen3('ocrad')
>   si.write(frame)
>   si.close()
>   messagetext += so.read()

If you use popen you should use *one* filehandle. The app
hangs because the buffer is full. See
http://docs.python.org/lib/popen2-flow-control.html


-- 
Thomas Güttler, http://www.thomas-guettler.de/ http://www.tbz-pariv.de/
E-Mail: guettli (*) thomas-guettler + de
Spam Catcher: niemand.leermann at thomas-guettler.de




More information about the Python-list mailing list