title: Removing files issue - Python
body: <p>Hit a bit of a snag, receiving error 32 cannot access file because it is being used by another process. However, this error only occurs intermittently. Why would that be? It occasionally removes the file, other times it throws the error message. </p>
  
  <p>if x and y:</p>
  
  <pre><code>for f in files:
      if f.endswith('.exe'):
          os.remove(f)
  </code></pre>