Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save linlincheng/c09d997df1bdcfaab818bd185972f2f4 to your computer and use it in GitHub Desktop.
Save linlincheng/c09d997df1bdcfaab818bd185972f2f4 to your computer and use it in GitHub Desktop.
#save new_list, a list of dictionaries to a csv file:
keys = tmp_list[0].keys()
with open("event_list.csv", "w") as f:
dict_writer = DictWriter(f, keys, delimiter=",")
dict_writer.writeheader()
for value in tmp_list:
dict_writer.writerow(value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment