PySerial: How to send Ctrl-C command on the serial line PySerial: How to send Ctrl-C command on the serial line python python

PySerial: How to send Ctrl-C command on the serial line


You should send a character with the ASCII code 3:

serial.write('\x03')


\x03

Which means 'end of text' or 'break' is what Ctrl+C sends.