title: how do i strip line in file using python
body: <p><strong>Input:</strong></p>
  
  <pre><code>dataaaaaaaaaaaaa,
  
  dataaaaaaaaaaaaaaaa,
  dataaaaaaaaaaaaaaa,
  </code></pre>
  
  <p><strong>output:</strong></p>
  
  <pre><code>dataaaaaaaaaaa,
  dataaaaaaaaaaa,
  dataaaaaaaaaaaa,
  </code></pre>
  
  <p><strong>code:</strong></p>
  
  <pre><code>with open('file') as f:
     for line in f:
       if not line.isspace():
         print lie.strip()
  </code></pre>
  
  <p><strong>out put of this code is:</strong></p>
  
  <pre><code>dataaaaaaa
  aa,
  dataaaaaaaa,
  dataaaaaaaa,
  </code></pre>
  
  <p>space and empty line are removed starting and ending of the file but single is break into two lines. I want to remove only spaces and empty lines. </p>
  
  <p>How can I achieve.</p>