title: Read file with (mostly) numbers
body: <p>The format is:</p>
  
  <pre><code>0
  995
  
  112
  // there is an empty line here too
  </code></pre>
  
  <p>So, I am doing:</p>
  
  <pre><code>with open("in.txt") as f:
      articles = f.readlines()
  for article in articles:
      article = int(article.split()[0])
  </code></pre>
  
  <p>but I am getting:</p>
  
  <blockquote>
    <p>IndexError: list index out of range</p>
  </blockquote>
  
  <p>which I think comes from accessing <code>[0]</code> of the lines that do not have a number. How to find that (I interesting in identifying the empty line, because it means that collecting the current list should stop and being prepared for the next one).</p>
  
  <pre><code>print articles
  ['0 \n', '995 \n', '\n', '112 \n', '\n']
  </code></pre>