def stop_cont(self, cont=True):
        for proc in psutil.process_iter():
            if proc.name() == self.process_name:
                sig = psutil.signal.SIGCONT if cont else psutil.signal.SIGSTOP
                proc.send_signal(sig)
                if self.debug:
                    sig = 'CONT' if cont else 'STOP'
                    print("Sent SIG%s to process %d" % (sig, proc.pid))
Send SIGSTOP/SIGCONT to processes called <name>
dataset/ETHPy150Open acrisci/i3ipc-python/examples/stop-application-on-unfocus.py/FocusMonitor.stop_cont