如何使用python为安装提示提供输入?

2024-06-09 00:16:20 发布

您现在位置:Python中文网/ 问答频道 /正文

如何为安装提供提示

enter import paramiko
from scp import SCPClient

def createSSHClient(server, port, user, password):
   client = paramiko.SSHClient()
   client.load_system_host_keys()
   client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
   client.connect(server, port, user, password)
   return client

stdin, stdout, stderr = createSSHClient('IP', 22, 'username', 'password').exec_command('./binfile.bin')

我有类似的提示。 是否要更新(是/否): 确认更改(是/否)

如何在脚本中自动处理和提供输入


Tags: fromimportclienthostparamikoserverportdef