f.seek() and f.tell() to read each line of text file
<p>I want to open a file and read each line using <code>f.seek()</code> and <code>f.tell()</code>:</p>

<p>test.txt:</p>

<pre><code>abc
def
ghi
jkl
</code></pre>

<p>My code is:</p>

<pre><code>f = open('test.txt', 'r')
last_pos = f.tell()  # get to know the current position in the file
last_pos = last_pos + 1
f.seek(last_pos)  # to change the current position in a file
text= f.readlines(last_pos)
print text
</code></pre>

<p>It reads the whole file.</p>
