问题
I've got a Python script managing a gdb process on Windows, and I need to be able to send a SIGINT to the spawned process in order to halt the target process (managed by gdb)
It appears that there is only SIGTERM available in Win32, but clearly if I run gdb from the console and Ctrl+C, it thinks it's receiving a SIGINT. Is there a way I can fake this such that the functionality is available on all platforms?
(I am using the subprocess module, and python 2.5/2.6)
回答1:
Windows doesn't have the unix signals IPC mechanism.
I would look at sending a CTRL-C to the gdb process.
来源:https://stackoverflow.com/questions/1095549/can-i-send-sigint-to-a-python-subprocess-on-windows