We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 498d3db commit 75a9fc2Copy full SHA for 75a9fc2
1 file changed
python_csv/append_function.py
@@ -13,7 +13,9 @@ def append_data(file_path, name, email):
13
next_id = get_length(file_path)
14
with open('data.csv', 'a', newline='') as csvfile:
15
writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
16
- writer.writeheader()
+ if next_id == 0:
17
+ writer.writeheader()
18
+ next_id = 1
19
writer.writerow({
20
"id": next_id,
21
"name": name,
0 commit comments