pipes and popen2

Stian Husemoen stianh at ifi.uio.no
Tue Jun 13 10:07:08 EDT 2000


[I wrote:]
>Problem is popen2 wont give me any output until I close stdin. Is there any
>way to both read and write to a program while keeping the pipe and
>process open? I can't seem to find any postings or documentation on this
>subject.


[Thomas Wouters wrote:]
>Curious, as I replied something very similar to someone else, only yesterday
>;-) The solution is to set the buffersize of the pipe, by passing the
>optional 2nd argument to popen2:

Yes, so you did... found your posting on deja now. I blame the 
time-machine <wink>   

Thanks for taking the time to answer me anyway :-)


>stdout, stdin = popen2.popen2('ispell -a', 1) # or something similarly small
>So that the read*() methods don't stop to wait for more input.

Aaahh, yes! Thanks again! 

-- 

Stian Husemoen <stianh>



More information about the Python-list mailing list