http://mmgen-wallet.i2p/project/mmgen/mmgen-wallet/src/7539c4d40d53bb8530b6c65c935a401a24154c33/mmgen/daemon.py
If multiple daemons are running, # the first PID in the list is returned and self.pids is set to the PID list. ss = f'{self.exec_fn}.exe' cp = self.run_cmd(['ps', '-Wl'], silent=True) self.pids = () # use Windows, not Cygwin, PID pids = tuple(line.split()[3] for line in cp.stdout.decode().splitlines() if ss in line) if pids: if len(pids) > 1: self.pids = pids return pids[0] elif self.platform in ('linux', 'darwin'): ss = ' '.join(self.start_cmd) cp = self.run_cmd(['pgrep',...