args = command.strip().split()
process = subprocess.Popen(args, shell=False, stdout=subprocess.PIPE,
    preexec_fn=os.setsid)
How do I close the stdout-pipe when killing a process started with python subprocess Popen?