写入文件json,csv

  1. csv 写入
import csv

def write_csv_row(data):
	#列表单行写入
	with open('test.csv','w',newline='') as f:
		csv_f = csv.writer(f)
		csv_f.writerow(['姓名','年龄','性别'])
		
def write_csv_rows(data):
	#二维列表多行写入
	with open('test.csv','w',newline='') as f

你可能感兴趣的:(爬虫,json,python,开发语言)