江西省程力&依维柯得意救护车轴距及相关信息
江西省程力&依维柯得意救护车轴距及相关信息江西省程力&依维柯得意救护车轴距是指依维柯底盘上由程力专...
程力专汽2024-12-23 23:45:060次
# -*- coding: utf-8 -*-
import os
import csv
import shutil
import time
def move_files_according_to_record():
current_directory = os.path.dirname(os.path.abspath(__file__))
move_directory = os.path.join(current_directory, "移动")
if not os.path.exists(move_directory):
os.mkdir(move_directory)
record_file_path = os.path.join(current_directory, "发布记录.csv")
moved_file_path = os.path.join(current_directory, "移动记录.csv")
# 读取已经移动的文件列表
moved_files = set()
if os.path.exists(moved_file_path):
with open(moved_file_path, "r", encoding="utf-8") as moved_file:
reader = csv.reader(moved_file)
for row in reader:
moved_files.add(row[0])
# 读取发布记录文件并移动文件
with open(record_file_path, "r", encoding="utf-8", newline='') as record_file:
reader = csv.reader(record_file)
for row in reader:
filename = row[0]
source_file_path = os.path.join(current_directory, filename)
destination_file_path = os.path.join(move_directory, filename)
if os.path.exists(source_file_path) and filename not in moved_files:
try:
shutil.move(source_file_path, destination_file_path)
print(f"已移动文件: {filename}")
# 记录移动成功的文件名
with open(moved_file_path, "a", encoding="utf-8", newline='') as moved_file:
writer = csv.writer(moved_file)
writer.writerow([filename])
except Exception as e:
print(f"移动文件{filename}时出现错误:{e}")
else:
print(f"未发现{filename},移动失败。")
if __name__ == "__main__":
move_files_according_to_record()
1 程力防暴车有哪几种类型 2024-12-24
2 程力采血车客户案例 2024-12-24
3 程力通信车高配价格分析 2024-12-24
4 程力连续抽油杆作业车低配的独特魅力 2024-12-24
5 程力运送型救护车如何购买 2024-12-24
6 程力运材半挂车栅格送风口——点燃物流行业的热风 2024-12-24
7 程力路政车内温度调节 2024-12-24
8 程力计量车综合实训系统——探索未来的汽车技术培训 2024-12-24
9 程力警用巡逻车购置税金额:税款与品质共创辉煌 2024-12-24
10 程力警用巡逻车各个按钮的功 能图解 2024-12-24
江西省程力&依维柯得意救护车轴距及相关信息江西省程力&依维柯得意救护车轴距是指依维柯底盘上由程力专...
阳泉市程力&依维柯得意救护车方式阳泉市程力&依维柯得意救护车方式指的是使用程力专用汽车股份有限公司...
鞍山市程力&依维柯得意救护车评论近年来,鞍山市程力&依维柯得意救护车在中国医疗行业中备受关注。程力...
海口市程力&依维柯得意救护车电源海口市程力&依维柯得意救护车电源是程力专用汽车股份有限公司以南京汽...
抚顺市程力&依维柯得意救护车一辆特价抚顺市程力&依维柯得意救护车一辆特价,您所需要的内容如下:车辆...