(conn)
r"""
    Redirects the other party's ``stdin``, ``stdout`` and ``stderr`` to 
    those of the local party, so remote IO will occur locally.

    Example usage::
    
        with redirected_stdio(conn):
            conn.modules.sys.stdout.write("hello\n")   # will be printed locally
r"""
    Redirects the other party's ``stdin``, ``stdout`` and ``stderr`` to 
    those of the local party, so remote IO will occur locally.
r Redirects the other party s stdin stdout and stderr to those of the local party so remote IO will occur locally .
def redirected_stdio(conn):
    r"""
    Redirects the other party's ``stdin``, ``stdout`` and ``stderr`` to 
    those of the local party, so remote IO will occur locally.

    Example usage::
    
        with redirected_stdio(conn):
            conn.modules.sys.stdout.write("hello\n")   # will be printed locally
    
    """
    orig_stdin = conn.modules.sys.stdin
    orig_stdout = conn.modules.sys.stdout
    orig_stderr = conn.modules.sys.stderr
    try:
        conn.modules.sys.stdin = sys.stdin
        conn.modules.sys.stdout = sys.stdout
        conn.modules.sys.stderr = sys.stderr
        yield
    finally:
        conn.modules.sys.stdin = orig_stdin
        conn.modules.sys.stdout = orig_stdout
        conn.modules.sys.stderr = orig_stderr
def redirected_stdio ( conn ) : orig_stdin = conn . modules . sys . stdin orig_stdout = conn . modules . sys . stdout orig_stderr = conn . modules . sys . stderr try : conn . modules . sys . stdin = sys . stdin conn . modules . sys . stdout = sys . stdout conn . modules . sys . stderr = sys . stderr yield finally : conn . modules . sys . stdin = orig_stdin conn . modules . sys . stdout = orig_stdout conn . modules . sys . stderr = orig_stderr