Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要通过 SSH 连接发送 Ctrl-Backslash,如何将其转换为字符串形式?
假设这fp是您正在写入的类似文件的对象,这应该可以工作。
fp
fp.write('\034')
Ps:我是通过echo «CONTROL-V»«CONTROL-BACKSLASH» | od -c在 Linux shell 中输入发现的:
echo «CONTROL-V»«CONTROL-BACKSLASH» | od -c
echo ^\ | od -c 0000000 034 \n 0000002