title: Delete file start with
body: <p>I want this function to delete files.  It does this correctly, but it <em>also</em> deletes folders, which I do not want.</p>
  
  <p>I also get an error during execution:</p>
  
  <pre><code>Access is denied: 'C:/temp3\\IDB_KKK
  </code></pre>
  
  <p>In folder temp3 i have:</p>
  
  <pre><code>IDB_OPP.txt
  IDB_KKK - folder
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>def delete_Files_StartWith(Path,Start_With_Key):
      my_dir = Path
      for fname in os.listdir(my_dir):
          if fname.startswith(Start_With_Key):
              os.remove(os.path.join(my_dir, fname))
  
  delete_Files_StartWith("C:/temp3","IDB_")
  </code></pre>