View Single Post
Posts: 46 | Thanked: 5 times | Joined on Sep 2009
#1
Is there any way to get a QTextBrowser to append lines read from stdout in real time?

Example (doesn't work)

Code:
proc = subprocess.Popen('/home/user/test.sh',
                               shell=True,
                               stdout=subprocess.PIPE,
                               )
for line in iter(proc.stdout.readline,''):
    self.displaybox.append(line)
    print line
This print statement works in real time, but self.displaybox doesn't append until test.sh it's done (basically a bunch of echo "foo's" with sleep 1's

Any ideas?