[SciPy-user] scipy.test output

Pearu Peterson pearu at cens.ioc.ee
Fri Nov 15 09:51:37 EST 2002


On Fri, 15 Nov 2002, RA wrote:

> I want to analyze and store the output of scipy.test().
> But it's a mixture of stdout and stderr, and the output after redirection via 
> shell (2>&1) is in the wrong order.
> I also tried 'import sys; sys.stderr = sys.stdout' before 'import scipy; 
> scipy.test()" without success.
> Any hint?

sys.stderr = sys.stdout would not work because some of the messages
may come from Fortran that are impossible to catch from Python.

Use script to get the desired result:

$ script scipy_test.log
$ python -c 'import scipy;scipy.test(1)'
$ ^D
$ less scipy_test.log

Pearu




More information about the SciPy-User mailing list