title: Python refuses to iterate through lines in a file more than once
body: <p>I am writing a program that requires me to iterate through each line of a file multiple times:</p>
  
  <pre><code>loops = 0
  file = open("somefile.txt")
  while loops &lt; 5:
      for line in file:
          print(line)
      loops = loops + 1
  </code></pre>
  
  <p>For the sake of brevity, I am assuming that I always need to loop through a file and print each line 5 times. That code has the same issue as the longer version I have implemented in my program: the file is only iterated through one time. After that the <code>print(line)</code> file does nothing. Why is this?</p>