title: Splitting a htm file into separate lines in python
body: <p>So I have a .htm file which I need to split into different lines and store in a list.
  So the code I used for this was as follows.</p>
  
  <pre><code>html = open('filename.htm').read().splitlines()
  </code></pre>
  
  <p>However when I do the following, the entire file is printed out at once and not line by line and so it seems the input from the file is not being split into different lines</p>
  
  <pre><code>for line in html:
      print(line)
  </code></pre>
  
  <p>Additionally, when i try to copy paste the contents of the file to the program, it works fine.</p>
  
  <pre><code>html = raw_input()
  html = html.splitlines()
  </code></pre>
  
  <p>Could anyone tell me how to get the input from the file to be split into different lines? Thanks.</p>