通过Python paramiko .send(命令)发送“暂停”键

时间:2020-03-17 12:29:26

标签: python ssh paramiko pause

当前通过SSH自动化终端,并能够使用Paramiko成功连接。作为最后一步的一部分,需要发送我无法发送的暂停键

示例代码(不完整)

client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect(hostname=ip,username=username,password=password)
remote_connection = client.invoke_shell()
....
remote_connections.send(chr(13))
...
output = remote_connection.recv(2000)
print(output)
client.close()

能够为换行发送Chr(10)或为回车发送Chr(13),但不知道要为“暂停”键发送的相应代码。

如果我通过第三方工具宏记录SSH会话,我会看到以下命令用于暂停,即chr(27)+“〜[C”,但在.send中使用相同的命令实际上会将字符发送到屏幕,即不执行它。

请咨询。

0 个答案:

没有答案