I have a CSV file called studentDetailsCopy and need to add a row of data to the end of it but at the moment it adds it to the end of the last row so it ends up looking like this: the as and the 28 on the end of the email are the data that needs to be added below it (line 28)
This is my code that is doing this:
newStudentAttributes = ([str(lastRowInt), newSurname, newForename, newDoB, newAddress, newHomePhoneNumber, newGender, newTutorGroup, newSchoolEmail])
with open('studentDetailsCopy.csv', 'a') as studentDetailsCSV:
writer = csv.writer(studentDetailsCSV, dialect='excel')
writer.writerow(newStudentAttributes)