I found something in the signal
Python documentation here; seems like you first have to import the signal
class, then use it as process.send_signal(signal.SIGINT)
, with SIGINT
being the signal
object representing a CTRL+C keyboard interrupt in Python.