How to send Ctrl + / to the stdin in Linux via byte string in Python?

510 Views Asked by At

I know I can send b'\x03' to send CTRL + C to Linux but I don't know the code for CTRL + \. What resource covers CTRL + <key>?

By way of background, I am writing a small test script that exercises my python asyncssh application and I am using ping as a way to prove out the function of the code. One of the tests I wanted to include was sending a command while ping was running and have the script read the intermediary statistic output. When you run ping localhost, you can send CTRL + \ in LINUX and this outputs 'N/N ... statistic summary: min/max... etc'. I send CTRL + C with b'\x03' just fine but can't figure out how to send CTRL + \. Any help?

0

There are 0 best solutions below