title: ignoring empty lines when comparing two files
body: <p>I have this comparison function that takes in two files and compares their content line by line. Problem is, it doesn't ignore the blank lines. So if I have the following as File1</p>
  
  <pre><code>Active Internet connections
  Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)        rxbytes    txbytes
  tcp4       0      0  192.168.1.6.50860      72.21.91.29.http       CLOSE_WAIT         892        691
  tcp4       0      0  192.168.1.6.50858      www.v.dropbox.co.https ESTABLISHED      27671       7563
  tcp4       0      0  192.168.1.6.50857      162.125.17.1.https     ESTABLISHED      17581       3642
  </code></pre>
  
  <p>and compare this with the following as File2</p>
  
  <pre><code>Active Internet connections
  Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)        rxbytes    txbytes
  tcp4       0      0  192.168.1.6.50860      72.21.91.29.http       CLOSE_WAIT         892        691
  
  
  
  
  tcp4       0      0  192.168.1.6.50858      www.v.dropbox.co.https ESTABLISHED      27671       7563
  tcp4       0      0  192.168.1.6.50857      162.125.17.1.https     ESTABLISHED      17581       3642
  </code></pre>
  
  <p>It will take the blank lines into account and compare those empty line with the content in file1.  I've tried using <code>strip()</code>, but  it deletes all the spaces in between each char, which I dont want. Is there a way to just delete the empty lines after each line?  I've highlighted the relevant part of my code. </p>
  
  <pre><code>def compare(baseline, newestFile):
  
  
  
      baselineHolder = open(baseline)
      newestFileHolder = open(newestFile)
  
      lines1 = baselineHolder.readlines()
      a = returnName(baseline)
      b = returnName(newestFile)
  
      for i,lines2 in enumerate(newestFileHolder):
              if not (isEmpty(baseline)) and not (isEmpty(newestFile)):
                  if lines2 != lines1[i]:
                      add1 = i + 1
                      print ("line ", add1, " in newestFile is different \n")
  </code></pre>