title: Find the last occurrence of a word in a large file with python
body: <p>I have a very large text file. I want to search for the last occurrence of a specific word and then perform certain operations on the lines that follows it.</p>
  
  <p>I can do something like:</p>
  
  <pre><code>if "word" in line.split():
      do something
  </code></pre>
  
  <p>I am only interested in the last occurrence of <code>"word"</code> however.</p>