Код: Выделить всё
ssh = paramiko.SSHClient()
ssh.connect(host)
stdin, stdout, stderr = ssh.exec_command(cmd)
Код: Выделить всё
# Wait for the command to finish
while not stdout.channel.exit_status_ready():
if stdout.channel.recv_ready():
stdoutLines = stdout.readlines()
Уместно ли что-то подобное?
Код: Выделить всё
# Wait until the data is available
while not stdout.channel.recv_ready():
pass
stdoutLines = stdout.readlines()
Как мне узнать, должны ли быть данные на стандартном выводе, прежде чем ждать в бесконечном цикле, пока stdout.channel.recv_ready() станет True (чего не происходит, если не предполагается, что быть любым выводом на стандартный вывод)?
Подробнее здесь: https://stackoverflow.com/questions/235 ... recv-ready