mlpy.auxiliary.misc.stdout_redirected

mlpy.auxiliary.misc.stdout_redirected(*args, **kwds)[source]

Preventing a C shared library to print on stdout.

Examples

>>> import os
>>>
>>> with stdout_redirected(to="filename"):
>>>    print("from Python")
>>>    os.system("echo non-Python applications are also supported")

Note

Project: Code from StackOverflow.
Code author: J.F. Sebastian
License: CC-Wiki