My question is almost the same as this one: Widget to Display subprocess stdout? but a step further.
I have the following code (python2.7):
def btnGo
This is an interesting solution. Would that be possible to have the whole working code?
I am asking because I was wonder how the while True does not block the usability of the whole GUI... does it not?
As suspected, I tried and this example is not really work. If you use something like "ls -Rf /" as command, you will see that the while loop will make the txt output flowing pretty well. However both windows (main and secondary) will block big time.
I suspect you need to send the print txt part in a separated thread or process. Or, if you use pygtk you can use stuff like
gobject.io_add_watch(self.ep1.stdout, # file descriptor
gobject.IO_IN, # condition
self.write_to_buffer ) # callback
which was actually invented for this.