def kill(pid):
    if os.name == 'nt':
        import ctypes
        handle = ctypes.windll.kernel32.OpenProcess(1, False, int(pid))
        if not ctypes.windll.kernel32.TerminateProcess(handle, 0):
            print "~ Cannot kill the process with pid %s (ERROR %s)" % (pid, ctypes.windll.kernel32.GetLastError())
            print "~ "
            sys.exit(-1)
    else:
        try:
            os.kill(int(pid), 15)
        except __HOLE__:
            print "~ Play was not running (Process id %s not found)" % pid
            print "~"
            sys.exit(-1)
dataset/ETHPy150Open eBay/restcommander/play-1.2.4/framework/pym/play/commands/daemon.py/kill