* Jerry Hill <malaclyp...@gmail.com> [130830 07:48]:
> On Fri, Aug 30, 2013 at 11:32 AM, Tim Johnson <t...@akwebsoft.com> wrote:
> >   The objective is to display all output, but to also separate error
> >   messages from normal output.
> 
> I still think you want to use communicate().  Like this:
> 
> p = subprocess.Popen(args,stderr=subprocess.PIPE,stdout=subprocess.PIPE)
> output, err = p.communicate()
> 
> That's it.  No need for a loop, or manually handling the fact that
> stderr and/or stdout could end up with a full buffer and start to
> block.
  The following code :
p = subprocess.Popen(args,stderr=subprocess.PIPE,stdout=subprocess.PIPE)
errmsg,output = p.communicate()
... Hangs
this code :
p = subprocess.Popen(args,stderr=subprocess.PIPE,stdout=subprocess.PIPE)
while 1 :
        output = p.stdout.read()
        if output :
                print(output)
        else : break
... works
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to