如何删除目录,即使其中的文件被python中的其他应用程序使用

2024-09-29 01:37:44 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用shutil模块删除一个目录,但是目录中的一个文件在一个应用程序中使用,但是仍然有任何方法可以克服这个错误并删除目录吗

删除目录的路径是till temp\u custom测试.img正在其他应用程序中使用的文件。你知道吗

WindowsError: [Error 32] The process cannot access the file because it is being used by another process: u'D:\MaharashtraIDSI\TempFolder\temp_custom\Testing.img'


Tags: 模块文件方法路径目录应用程序img错误