Howdy again,

I am running into a problem displaying stdout from a subprocess
command. I have a loop that checks to see if the subprocess is still
active, then reads a line in from stdout and sends it to the text
buffer. However, I can't seem to get my text buffer to print except
when the command ends. Obviously, I'm missing some logic behind how
loops work with pygtk.

Here's my code:
---------------------------
command = subprocess.Popen(cmd, stdout=subprocess.PIPE)

while command.poll() is None:
      line = command.stdout.readline()
      self.txtbuffer.insert_at_cursor(line)
---------------------------

Any ideas on how to read stdout line by line with subprocesses?

Avast!
Daniel Roesler
[email protected]
_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to