title: Python - kill hung process started using subprocess.Popen
body: <p>I've started a subprocess using:</p>
  
  <pre><code>proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
  output = proc.communicate()[0]
  </code></pre>
  
  <p>Sometimes the command <code>cmd</code> hangs so my Python script also hangs at this point. </p>
  
  <p>I'd like to let this run for a time (10 seconds?) and if I don't get a response, then simply kill the process and continue on with my script.</p>
  
  <p><strong>How can I do this?</strong></p>