标签:一个 写入 bsp row class iter python div writer
1. 创建一个空字典
dict = {}
2. 判断字典中有无目标索引
if a in dict
3. 字典中索引的值加一
dict[‘a‘] = dict.get(‘a‘, 0) + 1
4. 将字典写入csv文件
writer = csv.writer(csvfile) for key, value in dict.items(): writer.writerow([key, value])
标签:一个 写入 bsp row class iter python div writer
原文地址:https://www.cnblogs.com/o-din/p/10211664.html