def write_csv(file_name, headers, rows):
with open(file_name, 'a')as f:
f_csv = csv.DictWriter(f, headers)
# f_csv.writeheader() # 如果需要写入标题就可以
f_csv.writerows(rows)
f.close()
file_name ='ok.csv'
headers = ['企业信息', '人员信息']
rows = [{'企业信息':'c_detail', '人员信息':'123'}]
write_csv(file_name, headers, rows)