1 year ago

#50634

test-img

nndhawan

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

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?

python

stdin

ctrl

asyncssh

0 Answers

Your Answer

Accepted video resources