title: Print sections of a file from a matching line to an empty line
body: <p>I want to print sections of a file from a matching line to an empty line, so I am looking for a way to express</p>
  
  <pre class="lang-none prettyprint-override"><code>sed '/^Word .*/,/^$/'
  </code></pre>
  
  <p>in Python.</p>
  
  <p>For instance if |I had a file containing these sections:</p>
  
  <pre class="lang-none prettyprint-override"><code>Fruits
  Apples:  10
  Oranges: 20
  Bananas:  5
  
  Pastry
  Cupcakes: 5
  Buns:    10
  Waffles: 20
  </code></pre>
  
  <p>How do I get the <code>Fruits</code> section?</p>
  
  <p>In Perl I could do:</p>
  
  <pre class="lang-none prettyprint-override"><code>if ( /^Fruits/ .. /^$/ ) {
      print;
  }
  </code></pre>
  
  <p>But I don't know how to do this in Python.</p>