|
SU2
|
Public Member Functions | |
| def | __init__ (self, stdout=None, stderr=None) |
| def | __enter__ (self) |
| def | __exit__ (self, exc_type, exc_value, traceback) |
Public Attributes | |
| old_stderr | |
with SU2.io.redirect_output(stdout,stderr)
Temporarily redirects sys.stdout and sys.stderr when used in
a 'with' contextmanager
Example:
with SU2.io.redirect_output('stdout.txt','stderr.txt'):
sys.stdout.write("standard out")
sys.stderr.write("stanrard error")
# code
#: with output redirection
Inputs:
stdout - None, a filename, or a file stream
stderr - None, a filename, or a file stream
None will not redirect outptu
1.8.12