完善相关问题,并增加推理的部分代码
This commit is contained in:
@ -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) # 删除文件
|
||||
|
Reference in New Issue
Block a user