You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
227 B

  1. import sys
  2. import os
  3. import signal
  4. if sys.platform.startswith("win"):
  5. def taskkill(pid):
  6. os.system('taskkill /F /PID {:d} /T >NUL 2>NUL'.format(pid))
  7. else: # POSIX
  8. def taskkill(pid):
  9. os.kill(pid, signal.SIGTERM)