Relative Content

Tag Archive for pythonwindowsprocess

How to send a ctrl+c event to an .exe process that has been started by Python on Windows 10?

I’m trying to communicate to some lab equipment that streams data to my PC through TCP. The equipment provider has given a .exe that is run with arguments to configure the set-up. Once the user wants to end the stream, a keyboard ctrl+c command must be sent in the terminal. This then tells the program to stop the stream, convert the data, save the data and then close. This works perfecty within the windows terminal as it does not immediately terminate the .exe. When the .exe is running and then a keyboard command sent: