def run_thread(func, args, fd):
    '\n    Run a python function in a thread and wait for it to complete.\n    Redirect its output to fd\n    Args:\n        func: A python function to run\n        args: A tuple containing argument for the function\n        fd: a file descriptor\n    '
    manager = Manager()
    return_dict = manager.dict()
    p = Process(target=wrapper_io, args=(func, fd, args, return_dict))
    p.start()
    p.join()
    return return_dict['output']
Run a python function in a thread and wait for it to complete.
Redirect its output to fd
Args:
    func: A python function to run
    args: A tuple containing argument for the function
    fd: a file descriptor
def run_thread(func, args, fd):
    '\n    Run a python function in a thread and wait for it to complete.\n    Redirect its output to fd\n    Args:\n        func: A python function to run\n        args: A tuple containing argument for the function\n        fd: a file descriptor\n    '
    manager = Manager()
    return_dict = manager.dict()
    p = Process(target=wrapper_io, args=(func, fd, args, return_dict))
    p.start()
    p.join()
    return return_dict['output']