Python various delete files failed to share the processing mode

Source: Internet
Author: User
Here's a way to deal with the failure of Python's various delete files. Have a good reference value, hope to help you. Come and see it together.

The operation of invoking various delete files provided by Python failed

Return value 5, Access denied, but multiple confirmation that the file is not opened, the file is extracted from a zip package, there is no open read and write operations

The last call to Windows forced Delete command is done

Try:    #shutil. Rmtree (update_dir_str)  #this maybe can ' t delete some files by error 5    os.system ("rd/s/q directory Name") C3/>except Exception, E:    pass    print E

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.