title: How to terminate process created by Python Popen
body: <p>I'm running calc.exe (windows 10, python 3.6) using <code>proc = subprocess.Popen("calc.exe")</code>, then <code>time.sleep(time)</code> and then want to kill process: <code>os.kill(proc.pid, -9)</code> or <code>os.kill(proc.pid, signal.SIGTERM)</code> gives me error </p>
  
  <blockquote>
    <p>"Access Denied".</p>
  </blockquote>
  
  <p>I also tried proc.terminate - it didn't help.</p>
  
  <p>And I also noticed that proc.pid gives different PID from PID which is shown in task manager. Any ideas how to kill my process?</p>
  
  <p>Thanks!</p>