csv保存数据
时间:2022-05-27 22:10:46
收藏:0
阅读:14
import csv
import time,random
csv_lists=[[1,2],[3,4],[5,6]]
for csv_list in csv_lists:
time.sleep(random.randint(3,5))
with open("D:\pythonProject\技术提升\工具\读写文件\csv.csv", "a", encoding="UTF-8", newline="") as csvfile:
writer = csv.writer(csvfile)
writer.writerow(csv_list)
print(‘************************************‘)
print(f"索引:{csv_lists.index(csv_list)}")
print(f‘{csv_list}‘)
print(‘************************************‘)
print(‘存入完成‘)
原文:https://www.cnblogs.com/wolvies/p/15352948.html
评论(0)