# -*- coding: utf-8 -*-
"""
Created on Tue Jul 10 22:06:43 2018
@author: User
"""
import csv
datas = [['俄罗斯', '1707'],
['加拿大', 997],
['中国', 960],
['美国', '936']]
with open('d:/0tixiao/country.csv', 'w', newline='') as csvfile:
writer = csv.writer(csvfile)
for row in datas:
writer.writerow(row)
打开country.csv文件:
俄罗斯,1707
加拿大,997
中国,960
美国,936