title: Blocking writing to stdout
body: <p>I'm writing a Python script that will use subprocesses. The main idea is to have one parent script that runs specialised child scripts, which e.g. run other programs or do some stuff on their own. There are pipes between parent script and subprocesses. I use them to control whether subprocess is still responding by sending some characters on regular basis and checking the response. The problem is that when the subprocess prints anything on screen (i.e. writes to stdout or stderr), the pipes are broken and everything crashes. So my main question is whether it is possible to block writing to std* in the subprocess, so only legitimate response written to pipe would be possible? I have already tried <a href="https://stackoverflow.com/questions/10321671/stop-a-function-from-writing-to-stdout">Stop a function from writing to stdout</a> but without any success.</p>
  
  <p>Also other ideas for communcation between parent and subprocess are welcome (except file based pipes). However, the subprocesses must be used.</p>