title: How to read the output of long running ssh command continuously without blocking using paramiko
body: <p>I am trying to read the output of a long-running ssh command continuously. I understand that <code>exec_command</code> is non-blocking. But as soon as I use <code>stdout.readlines()</code> it becomes blocking. I don't want to wait for 10 minutes for my ssh command to finish to read all the output lines. I want to get the output as soon as the ssh command writes in stdout. Is there a way to do it?</p>
  
  <pre><code>import paramiko
  #import select
  ssh=paramiko.SSHClient()
  ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  ssh.connect(hostname,username=username,password=password)
  #transport = ssh.get_transport()
  #channel = transport.open_session()
  stdin,stdout,stderr = ssh.exec_command(command)
  print stdout.readlines()
  </code></pre>