[Baypiggies] Subprocess: Common problem/common pattern
glen at glenjarvis.com
Sat Oct 2 19:17:37 CEST 2010
I'm sorry, I thought I was more clear with my test case. Obviously, I was
The problem is this:
Python programs can call subprocesses. The python program can wait until
the subprocess has finished and print the output captured. However, what we
want is to print the output immediately as it is generated.
So, instead of waiting for the subprocess to finish, the python program
could continue -- printing the results as given by the subprocess. From the
way the test case is written, the communicate() method will wait until the
subprocess is finished *before* it prints the results that were found.
Thanks for asking for clarification. You weren't the only person asking, so
obviously I wasn't clear enough in defining the problem.
On Sat, Oct 2, 2010 at 10:13 AM, Aahz <aahz at pythoncraft.com> wrote:
> On Sat, Oct 02, 2010, Glen Jarvis wrote:
> > I've now seen a common problem come up several times. And, I imagine
> > is a common solution to this problem that I don't know.
> Could you explain what the problem is? I think it's related to buffering
> and pipes, but it's not clear from your post.
> Aahz (aahz at pythoncraft.com) <*>
> "If you think it's expensive to hire a professional to do the job, wait
> until you hire an amateur." --Red Adair
> Baypiggies mailing list
> Baypiggies at python.org
> To change your subscription options or unsubscribe:
Whatever you can do or imagine, begin it;
boldness has beauty, magic, and power in it.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Baypiggies