Did I find the right examples for you? yes no Crawl my project Python Jobs
All Samples(4) | Call(4) | Derive(0) | Import(0)
def check_pid(pid): """Check if a process is running with the given ``PID``. *Availability: Only on POSIX systems* Return ``True`` if there is a process running with the given ``PID``. """ try: os.kill(pid, 0) except OSError: return False else: return True
old_pid = int(pid_file.read()) pid_file.close() if tools.check_pid(old_pid): if not opts.quit and not opts.kill: stderr('There\'s already a Willie instance running with this config file')
os.kill(old_pid, signal.SIGTERM) sys.exit(0) elif not tools.check_pid(old_pid) and (opts.kill or opts.quit): stderr('Willie is not running!') sys.exit(1)
src/w/i/willie-HEAD/willie.py willie(Download)
old_pid = int(pid_file.read()) pid_file.close() if tools.check_pid(old_pid): if not opts.quit and not opts.kill: stderr('There\'s already a Willie instance running with this config file')
os.kill(old_pid, signal.SIGTERM) sys.exit(0) elif not tools.check_pid(old_pid) and (opts.kill or opts.quit): stderr('Willie is not running!') sys.exit(1)