Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I send SIGINT to a Python subprocess on Windows?

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)

like image 450
Ryan Avatar asked Nov 15 '22 15:11

Ryan


1 Answers

Windows doesn't have the unix signals IPC mechanism.

I would look at sending a CTRL-C to the gdb process.

like image 80
drudru Avatar answered Dec 14 '22 14:12

drudru