def kill_pid(pid, signal=15):
 try:
  psutil.Process(pid).send_signal(signal)
  return True
 except psutil.NoSuchProcess:
  return False

def kill_pid ( pid , signal = 15 ) : try : psutil . Process ( pid ) . send_signal ( signal ) return True except psutil . NoSuchProcess : return False
kill a process by pid .