Get output from a Paramiko SSH exec_command continuously
A minimal and complete working example of how to use this answer (tested in Python 3.6.1) # run.py from paramiko import SSHClient ssh = SSHClient() ssh.load_system_host_keys() ssh.connect(‘…’) print(‘started…’) stdin, stdout, stderr = ssh.exec_command(‘python -m example’, get_pty=True) for line in iter(stdout.readline, “”): print(line, end=””) print(‘finished.’) and # example.py, at the server import time for x in … Read more