This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from multiprocessing import Process, Queue | |
from time import sleep | |
import ctypes | |
# WINDOWS ONLY!!! | |
def interrupt_process(pid): | |
CTRL_C_EVENT = 0x0 | |
ctypes.windll.kernel32.GenerateConsoleCtrlEvent(CTRL_C_EVENT, pid) | |
# DON'T USE THIS!!! THIS WON'T WORK AND GENERATES A COMPLETELY DIFFERENT |