##写入csv
dic=[1,2,3,4,5]
# # file = open('21.txt', mode='w',encoding='UTF-8')
# # file.write(dic)
# # # 关闭文件,不关闭文件可能会出问题
# # file.close()
#########################################################
##写入csv
import csv
f=open('data.csv','w')
csvwriter=csv.writer(f)
dic=[1,2,3,4,5]
csvwriter.writerow(dic)
f.close()