title: Python: Delete locked file
body: <p>How do I delete a file with Python (Windows) that has a read lock?</p>
  
  <p>The obvious, doesn't work:</p>
  
  <pre><code>  import os
    os.remove("test_file.csv")
    Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
     WindowsError: [Error 32] The process cannot access the file because it is being
     used by another process: 'test_file.csv'
  </code></pre>