title: Read output line by line in python
body: <p>hi i want to make ssh connection and parse some datas. Im using paramiko and here is part of my code:</p>
  
  <pre><code>ssh=ssh_pre.invoke_shell()
  ssh.send("display ospf peer brief \n")
  output = ssh.recv(10000)
  </code></pre>
  
  <p>everything work until this part</p>
  
  <pre><code>buf=StringIO.StringIO(output)
  for lines in buf.read()
      print lines
  </code></pre>
  
  <p>this code print chars line by line . I want to print lines . what should i do?</p>