(path)
Redirect stdout and stderr to a file.
Redirect stdout and stderr to a file.
Redirect stdout and stderr to a file .
def redirect_output(path):
    '''Redirect stdout and stderr to a file.'''
    outfile    = open(path, 'a')
    sys.stdout = outfile
    sys.stderr = outfile
def redirect_output ( path ) : outfile = open ( path , 'a' ) sys . stdout = outfile sys . stderr = outfile