Answer the question
In order to leave comments, you need to log in
How to add an empty element to the end when writing to csv?
There is a function that saves data in csv
def csv_writer(data, path):
with open(path, 'a', newline='', encoding='utf-8') as csvfile:
spamwriter = csv.writer(csvfile, delimiter=';', quoting=csv.QUOTE_MINIMAL)
spamwriter.writerow(data)
Answer the question
In order to leave comments, you need to log in
If we're talking about extra. separator after the last value, then you can use extra. parameter or artificially add an empty column by changing the linelineterminator=";\r\n"
spamwriter.writerow(data + [None])
Added an additional parameter to the function and everything turned out lineterminator=";\r\n"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question