'**Arguments:**
name            Optional name for this process used when printing messages
from the remote process.
target          Optional function to call after starting remote process.
By default, this is startEventLoop(), which causes the remote
process to process requests from the parent process until it
is asked to quit. If you wish to specify a different target,
it must be picklable (bound methods are not).
copySysPath     If True, copy the contents of sys.path to the remote process
debug           If True, print detailed information about communication
with the child process.
wrapStdout      If True (default on windows) then stdout and stderr from the
child process will be caught by the parent process and
forwarded to its stdout/stderr. This provides a workaround
for a python bug: http://bugs.python.org/issue3905
but has the side effect that child output is significantly
delayed relative to the parent output.'

def __init__(self, name=None, target=None, executable=None, copySysPath=True, debug=False, timeout=20, wrapStdout=None):

    if (target is None):
        target = startEventLoop
    if (name is None):
        name = str(self)
    if (executable is None):
        executable = sys.executable
    self.debug = (7 if (debug is True) else False)
    authkey = os.urandom(20)
    if sys.platform.startswith('win'):
        authkey = None
    l = multiprocessing.connection.Listener(('localhost', 0), authkey=authkey)
    port = l.address[1]
    sysPath = (sys.path if copySysPath else None)
    bootstrap = os.path.abspath(os.path.join(os.path.dirname(__file__), 'bootstrap.py'))
    self.debugMsg(('Starting    child    process    (%s    %s)' % (executable, bootstrap)))
    if debug:
        procDebug = ((Process._process_count % 6) + 1)
        Process._process_count += 1
    else:
        procDebug = False
    if (wrapStdout is None):
        wrapStdout = sys.platform.startswith('win')
    if wrapStdout:
        stdout = subprocess.PIPE
        stderr = subprocess.PIPE
        self.proc = subprocess.Popen((executable, bootstrap), stdin=subprocess.PIPE, stdout=stdout, stderr=stderr)
        self._stdoutForwarder = FileForwarder(self.proc.stdout, 'stdout', procDebug)
        self._stderrForwarder = FileForwarder(self.proc.stderr, 'stderr', procDebug)
    else:
        self.proc = subprocess.Popen((executable, bootstrap), stdin=subprocess.PIPE)
    targetStr = pickle.dumps(target)
    pid = os.getpid()
    data = dict(name=(name + '_child'), port=port, authkey=authkey, ppid=pid, targetStr=targetStr, path=sysPath, pyside=USE_PYSIDE, debug=procDebug)
    pickle.dump(data, self.proc.stdin)
    self.proc.stdin.close()
    self.debugMsg(('Listening    for    child    process    on    port    %d,    authkey=%s..' % (port, repr(authkey))))
    while True:
        try:
            conn = l.accept()
            break
        except IOError as err:
            if (err.errno == 4):
                continue
            else:
                raise
    RemoteEventHandler.__init__(self, conn, (name + '_parent'), pid=self.proc.pid, debug=self.debug)
    self.debugMsg('Connected    to    child    process.')
    atexit.register(self.join)
