This commit is contained in:
dongchangxi committed 2025-06-17 21:39:24 +08:00
1 parent 0ebdcf85f6
commit 6a06c3c8e7
1 file changed
+5 -1
+5 -1
View File
@@ -146,7 +146,11 @@ def checkIsFinish(driver, pid, orderId,styleNumber):
#清除指定文件夹下的所有文件 #清除指定文件夹下的所有文件
def clearFolder(folder): def clearFolder(folder):
for file in os.listdir(folder): for file in os.listdir(folder):
os.remove(os.path.join(folder, file)) #判断如果是文件夹,则整个删除
if os.path.isdir(os.path.join(folder, file)):
shutil.rmtree(os.path.join(folder, file))
else:
os.remove(os.path.join(folder, file))
#检测输入目录里是否有输入的文件存在 #检测输入目录里是否有输入的文件存在