grayaii schrieb:
> Awesome! That worked!
> And your comment just led me down another exploration path on why the
> following doesn't work:
> ---------------------
> while(returncode is None):
>       returncode = run.poll()
>       time.sleep(1)
> 
> out = run.stdout.readlines()
> err = run.stderr.readlines()
> ---------------------
> Nowhere in the loop am I reading stdout or err.
> I'm only reading it after the loop has finished, and when running the
> exe, returncode is *always* None.
> Now I have to figure out a way to read it within the loop without
> blocking the read... on Windows...

the subprocess has already a canonical way:

out, err = run.communicate()

Your code may still block if the stderr buffer is full during the
stdout.readlines() call.

Christian

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to