Why is read loop skipping lines?
<p>I can't tell why my read file loop is skipping lines.</p>

<p>I'm trying to write a simple program in python to parse a txt document before running it in another.  What I essentially have is a text file that looks like a triangle that I'm trying to parse into a list in a list i.e.</p>

<pre><code>1

2 3

4 5 6

7 8 9 10
</code></pre>

<p>into</p>

<pre><code>[[1],[2,3],[4,5,6],[7,8,9,10]]
</code></pre>

<p>However, in my code below, my while loop seems like it's "skipping" every other line so instead of getting the above list, I get something like <code>[[2,3],[7,8,9,10]]</code>.  What's even more baffling is that if i comment out the last line, the while loop will print '1' exactly the correct number of times</p>

<pre><code>f = open('test.txt')
triangle = []

while f.readline() != '':
    print 1
    triangle.append(map(int,f.readline().strip().split()))
</code></pre>
