title: Write new data into the middle of a file
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/125703/how-do-i-modify-a-text-file-in-python">How do I modify a text file in Python?</a>  </p>
  </blockquote>
  
  
  
  <p>It's easy to write a new file, append to it, etc.  But how can I write to the middle of a file?   </p>
  
  <p>I have an html report that is generated off of an automated process, and rather than rewrite the whole report, I want to just insert new data where it's new.  Perhaps I want to look for a comment and append there.  So, add new data after the line <code>&lt;!-- append here --&gt;</code></p>