Delete files and subfolders with files in folder
<p>i am using following code to delete all files in one folder that consist of zip file I will not to be deleted and one txt file and one subfolder that consist of lot of txt files and two subfolders with files:</p>

<pre><code>for file_object in os.listdir(folder_path):
    file_object_path = os.path.join(folder_path, file_object)
    print file_object_path
    if os.path.isfile(file_object_path):
        if 'zip.zip' in file_object:
            pass
        else:
            print ('       Deleting file ' + file_object)
            os.unlink(file_object_path)
    else:
        print ('       Deleting folder ' + file_object)
        rmtree(file_object_path)
</code></pre>

<p>But result is Error 5 Access denied to delete subfolder. Other files in main folder has not been deleted because first file to be checked was actually subfolder with access denied. I hope someone understand description of problem I have :)</p>
