title: printing lines between start and end point
body: <p>Let's say I have a text file in this format:</p>
  
  <pre><code>***a
  foo bar
  lorem ipsum
  dolor
  ---a
  </code></pre>
  
  <p>I want to print the lines between <code>***a</code> and <code>---a</code> I'm trying to do it with this:</p>
  
  <pre><code>def printlines():
      pattern = open('text.txt').read().splitlines()
      for line in pattern:
          if line == "***a":
              pass
              while line != "---a":
                  print line
  
          else:
              pass
  </code></pre>
  
  <p>But it prints <code>***a</code> in an infinite loop. How can I solve this?</p>