title: Paramiko: read from standard output of remotely executed command
body: <p>so I was working with paramiko for some basic SSH testing and I'm not getting any output into stdout. Heres my code. </p>
  
  <pre><code>import paramiko
  client=paramiko.SSHClient()
  client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  com="ls ~/desktop"
  client.connect('MyIPAddress',MyPortNumber, username='username', password='password')
  output=""
  stdin, stdout, stderr = client.exec_command(com)
  
  print "ssh succuessful. Closing connection"
  client.close()
  print "Connection closed"
  stdout=stdout.readlines()
  print stdout
  print com
  for line in stdout:
      output=output+line
  if output!="":
      print output
  else:
      print "There was no output for this command"
  </code></pre>
  
  <p>So whenever I run this, the command is executed (as seen by if I do something like a cp, the file is copied), but I always get "There was no output for this command". When stdout=stdout.readlines() is printed, [] is the output. In addition, if I add a print statement into the for loop, it never gets run. Could someone help me out here? Thanks!</p>