Ok, I tried that, but it's giving an error about the number of arguments sent to read_output. "TypeError: display_details() takes exactly 2 arguments (3 given)"
Here's my code: -------------------------- gobject.io_add_watch(command.stdout, gobject.IO_IN | gobject.IO_HUP, self.read_output) .... def read_output(source, condition): if condition == gobject.IO_IN: line = source.readline() self.txtbuffer.insert_at_cursor(line) if condition == gobject.IO_HUP: self.txtbuffer.insert_at_cursor("Command finished.") return False return True -------------------------- Any ideas on why this is occurring? Avast! Daniel Roesler diaf...@gmail.com On Thu, Jan 22, 2009 at 2:45 PM, John Finlay <fin...@moeraki.com> wrote: > > Don't use command.poll() rather use gobject.io_add_watch to register a > callback when data is available on the stdout pipe or the pipe is closed. > Something like: > > gobject.io_add_watch(command.stdout, gobject.IO-IN | gobject.IO_HUP, > read_output) > > def read_output(source, condition): > if condition == gobject.IO_IN: > line = source.readline() > .... > if condition == gobject.IO_HUP: > .... > return False > > return True > > > John > > _______________________________________________ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/