I sincerely apologies if this is an already answered question, I have looked at many resources already and all either make no sense to me or only work in python 2x.
So basically, I have a list which the user appends.
print("\nPlease enter all relevant information\n")
A = []
A.append(input("thing: "))
A.append(input("thing2 : "))
A.append(input("etc : "))
I want to add all this information into an imported cvs file (which already has several lines) so it would be on a new row and would look something like this
thing,thing2,etc
This is the code I have for this
f = open('Datafile.csv', "wb")
datafile = csv.writer(f, delimiter=',')
for item in A:
datafile.writerow(item)
f.close()
but it doesn't seem to work
error =
File "Filepath", line 57, in new
datafile.writerow(item)
TypeError: 'str' does not support the buffer interface