Open
Description
We only need to write the headers once, so if we modify the "write" block to see if this is the first time we're writing the CSV, we don't keep seeing headers added to the file when we've gone back to add new books:
if len(new_additions) > 0:
with open(filename, 'a') as csvfile:
writer = csv.DictWriter(csvfile, fieldnames=fields)
if current_ID == 1:
writer.writeheader()
for item in new_additions:
writer.writerow(item)
Metadata
Metadata
Assignees
Labels
No labels