simple popen question

Jim Benson jbenson at sextans.lowell.edu
Fri Apr 2 21:07:56 EST 2004


On Fri, 2 Apr 2004, Cameron Laird wrote:

> In article <mailman.292.1080946675.20120.python-list at python.org>,
> Jim Benson  <jbenson at sextans.lowell.edu> wrote:
> >
> >Is there an easy way to turn off the buffering?
> >I tried adding the extra 'r' and a small bufsize
> >to the popen...no difference.
> 			.
> 			.
> In general, no; the reader doesn't control the buffering, the writer does.
> 

The reason i suspect popen is that when i run
the executable from the unix shell...i see every
output line ~ when expected. 

> But there are several tangential issues raised here.  Most crucially:  do
> you control the (source of the) "binary executable"?  If you do, what I
> think you'll find most satisfying is to recompile it with buffering disabled,
> at least on newlines.
> 

I do control the executable...i wrote that as well. 
The lack of obvious buffering as viewed from the unix shell
vs. python popen/readline is what is confusing to me.

Thanks, 

Jim
 






More information about the Python-list mailing list