(command, pid_filename, env=None)
Run `command` in the background, writing its PID in `pid_filename`.
Run `command` in the background, writing its PID in `pid_filename`.
Run command in the background writing its PID in pid_filename .
def run_background_command(command, pid_filename, env=None):
    """Run `command` in the background, writing its PID in `pid_filename`."""
    if ON_WINDOWS:
        process = subprocess.Popen(command, env=env, creationflags=subprocess.CREATE_NEW_PROCESS_GROUP)
    else:
        process = subprocess.Popen(command, env=env, start_new_session=True)
    with open(pid_filename, 'w') as pid_file:
        pid_file.write(str(process.pid))
def run_background_command ( command , pid_filename , env = None ) : if ON_WINDOWS : process = subprocess . Popen ( command , env = env , creationflags = subprocess . CREATE_NEW_PROCESS_GROUP ) else : process = subprocess . Popen ( command , env = env , start_new_session = True ) with open ( pid_filename , 'w' ) as pid_file : pid_file . write ( str ( process . pid ) )