Re: [Tutor] capture output from a subprocess while it is being produced

2016-06-14 Thread eryk sun
On Tue, Jun 14, 2016 at 8:03 PM, Albert-Jan Roskam wrote: > > proc = Popen("ls -lF", cwd=cwd, shell=True, stdout=PIPE, stderr=PIPE) Don't use shell=True if you can avoid it. "ls" isn't a shell command. Use ['ls', '-lF']. The child process probably buffers its output

Re: [Tutor] capture output from a subprocess while it is being produced

2016-06-14 Thread Alan Gauld via Tutor
On 14/06/16 21:03, Albert-Jan Roskam wrote: > from subprocess import Popen, PIPE > from threading import Thread > from collections import deque > import sys > import time > import os.path > > > def process(dq): > """Run a commandline program, with lots of output""" > cwd =

[Tutor] capture output from a subprocess while it is being produced

2016-06-14 Thread Albert-Jan Roskam
Hi, I have a Tkinter program where I can fire up a commandline program which could run for quite a while (let's say 15 minutes or more). While the program is running, I would like to show the output that I normally see in the terminal (actually, the target platform is windows but now I am on