Created
September 8, 2017 06:44
-
-
Save Ailuropoda1864/2cf0823ac30b6963479b6a4fbf14068f to your computer and use it in GitHub Desktop.
append a row to a csv file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
def append_to_csv(csvfile, entry): | |
""" | |
append a row to a csv file | |
:param csvfile: the path to a .csv file | |
:param entry: a list representing a row in the .csv file | |
:return: None | |
""" | |
with open(csvfile, 'a', newline='') as f: | |
entry_writer = csv.writer(f, delimiter=',', quoting=csv.QUOTE_MINIMAL) | |
entry_writer.writerow(entry) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment