dongchangxi 6 months ago
parent
commit
6a06c3c8e7
  1. 4
      comfyui/main.py

4
comfyui/main.py

@ -146,6 +146,10 @@ def checkIsFinish(driver, pid, orderId,styleNumber):
#清除指定文件夹下的所有文件 #清除指定文件夹下的所有文件
def clearFolder(folder): def clearFolder(folder):
for file in os.listdir(folder): for file in os.listdir(folder):
#判断如果是文件夹,则整个删除
if os.path.isdir(os.path.join(folder, file)):
shutil.rmtree(os.path.join(folder, file))
else:
os.remove(os.path.join(folder, file)) os.remove(os.path.join(folder, file))

Loading…
Cancel
Save