def generate_csv(domains, file_name):
output = open(file_name, 'w')
writer = csv.writer(output)
# First row should always be the headers
writer.writerow(CSV_HEADERS)
for domain in domains:
row = []
# Grab the dictionary for each row.
# Keys for the dict are the column headers.
results = domain.generate_results()
for column in CSV_HEADERS:
row.append(results[column])
writer.writerow(row)
output.close()
评论列表
文章目录