完善相关问题,并增加推理的部分代码

This commit is contained in:
2025-02-28 16:30:11 +08:00
parent 0301e41e96
commit 4262d3e908
20 changed files with 564 additions and 32 deletions

View File

@ -79,3 +79,14 @@ def copy_and_rename_file(src_file_path, dst_dir, new_name):
# 复制文件到目标位置并重命名
shutil.copy(src_file_path, dst_file_path)
def delete_file_if_exists(*file_paths: str):
"""
删除文件
:param file_path:
:return:
"""
for path in file_paths:
if os.path.exists(path): # 检查文件是否存在
os.remove(path) # 删除文件