Re: Reading output from a child process non-blockingly

2005-06-30 Thread Adriaan Renting
I use the pty module, in combination with select.select. Search for Pexpect for an elaborate example. It basically goes something like this: - import os, select, pty pid, fd = pty.fork() fd_eof = 0 if pid == 0: os.execvp('ls',['ls']) # child proce

Re: Reading output from a child process non-blockingly

2005-06-29 Thread Dan Sommers
On Wed, 29 Jun 2005 15:45:20 +0200, Thomas Guettler <[EMAIL PROTECTED]> wrote: > Check out.log with "tail" or "less +F". Do you see the data appear in > small chunks? ... You'll need "tail -f", I think. Regards, Dan -- Dan Sommers -- http://mail.python.org/

Re: Reading output from a child process non-blockingly

2005-06-29 Thread Thomas Guettler
Am Wed, 29 Jun 2005 16:08:54 +0800 schrieb Yuan HOng: > In my program I have to call an external program and parse its output. > For that I use the os.popen2 function, and then read the output > stream. [cut] > I tried use select.select on the output stream returned by os.popen2, > but it returns

Re: Reading output from a child process non-blockingly

2005-06-29 Thread ilochab
Yuan HOng ha scritto: > In my program I have to call an external program and parse its output. > For that I use the os.popen2 function, and then read the output > stream. > > But the complexity is that the external program gives back its output > in a piecemeal manner, with long delays between th