def run(self, stdout_func = None, stdin_func = None, stderr_func = None):
if stdout_func == None and stdin_func == None and stderr_func == None:<EOL><INDENT>return self._run_stdio()<EOL><DEDENT>if stderr_func != None and self.mergeout:<EOL><INDENT>raise RuntimeError("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>stdin_thread = None<EOL>threads = []<EOL>if stdin_func:<EOL><INDENT>stdin_thread = threading.Thread(target=self._stdin_thread,<EOL>args=(self.hstdin, self.piProcInfo.hProcess,<EOL>stdin_func, stdout_func))<EOL><DEDENT>threads.append(threading.Thread(target=self._stdout_thread,<EOL>args=(self.hstdout, stdout_func)))<EOL>if not self.mergeout:<EOL><INDENT>if stderr_func == None:<EOL><INDENT>stderr_func = stdout_func<EOL><DEDENT>threads.append(threading.Thread(target=self._stdout_thread,<EOL>args=(self.hstderr, stderr_func)))<EOL><DEDENT>if ResumeThread(self.piProcInfo.hThread) == <NUM_LIT>:<EOL><INDENT>raise ctypes.WinError()<EOL><DEDENT>if stdin_thread is not None:<EOL><INDENT>stdin_thread.start()<EOL><DEDENT>for thread in threads:<EOL><INDENT>thread.start()<EOL><DEDENT>if WaitForSingleObject(self.piProcInfo.hProcess, INFINITE) ==WAIT_FAILED:<EOL><INDENT>raise ctypes.WinError()<EOL><DEDENT>for thread in threads:<EOL><INDENT>thread.join()<EOL><DEDENT>if stdin_thread is not None:<EOL><INDENT>stdin_thread.join()<EOL><DEDENT>
Runs the process, using the provided functions for I/O.

        The function stdin_func should return strings whenever a
        character or characters become available.
        The functions stdout_func and stderr_func are called whenever
        something is printed to stdout or stderr, respectively.
        These functions are called from different threads (but not
        concurrently, because of the GIL).