title: How to kill a process using process name in python script
body: <p>My requirement is to kill a process. I have the process name.
  Below is my code:</p>
  <pre><code>def kill_process(name):
    os.system(f&quot;TASKKILL /F /IM {name}&quot;)
  </code></pre>
  <p>It works for Windows but not for Mac. My requirement is that it should work for both the OS.
  Is there a way to make the above code OS independent or how can I code it for Mac?</p>
  <p>Any help is appreciated.
  Thank you.</p>
  <p>Regards,
  Rushikesh Kadam.</p>