python怎么导出csv
收起
云计算小粉
2018-05-10 20:09:44
3674
0
1
条回答
写回答
取消
提交回答
-
使用csv
# coding: utf-8
import csv
csvFile = open('test.csv', 'wb')
writer = csv.writer(csvFile)
writer.writerow(['姓名', '年龄', '电话'])
data = [
('张三', '18', '13609988834'),
('李四', '20', '13803830013')
]
writer.writerows(data)
csvFile.close()
2019-07-17 22:19:34