title: How to kill a process by name in Python on ubuntu?
body: <p>For example, I want to kill 'test.py', and I tried:</p>
  <pre><code>pkill -9 test.py
  </code></pre>
  <p>But this doesn't work. If I am running a multiprocess program, to kill by pid will require a lots of kills due to the multiple processes used. Is there a way to kill the whole program without killing one by one using PID?</p>