title: Why does readline() not work after readlines()?
body: <p>In Python, say I have:</p>
  
  <pre><code>f = open("file.txt", "r")
      a = f.readlines()
      b = f.readline()
      print a
      print b
  </code></pre>
  
  <p><code>print a</code> will show all the lines of the file and <code>print b</code> will show nothing.</p>
  
  <p>Similarly vice versa:</p>
  
  <pre><code>f = open("file.txt", "r")
      a = f.readline()
      b = f.readlines()
      print a
      print b
  </code></pre>
  
  <p><code>print a</code> shows the first line but <code>print b</code> will show all lines except the first one.</p>
  
  <p>If both <code>a</code> and <code>b</code> are readlines(), <code>a</code> will show all the lines and <code>b</code> will show nothing.</p>
  
  <p>Why does this happen? Why can't both commands work independently of each other? Is there a workaround for this?</p>