[Numpy-discussion] Silencing NumPy output

Robert Kern robert.kern at gmail.com
Fri Nov 15 14:41:36 EST 2013


On Fri, Nov 15, 2013 at 7:28 PM, David Cournapeau <cournape at gmail.com>
wrote:
>
> On Fri, Nov 15, 2013 at 6:21 PM, Charles R Harris <
charlesr.harris at gmail.com> wrote:

>> Sure, give it a shot. Looks like subprocess.Popen was intended to
replace os.system in any case.
>
> Except that output is not 'real time' with straight Popen, and doing so
reliably on every platform (cough - windows - cough) is not completely
trivial. You also have to handle buffered output, etc... That code is very
fragile, so this would be quite a lot of testing to change, and I am not
sure it worths it.

It doesn't have to be "real time". Just use .communicate() and print out
the stdout and stderr to their appropriate streams after the subprocess
finishes.

--
Robert Kern
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20131115/17f5ef53/attachment.html>


More information about the NumPy-Discussion mailing list