code: def get_pid(name):
      
      if not shutil.which("pidof"):
          return False
  
      try:
          subprocess.check_output(["pidof", "-s", name])
      except subprocess.CalledProcessError:
          return False
  
      return True
docs: Check if process is running by name.