I have a nested list like this:
[['Bike No.', 'Purchase Date', 'Batt %', 'Last Maintenance', 'KM since Last', 'Service?'],
['T101', '10/4/2016', '55', '10/1/2017', '25.08', 'N'],
['T102', '1/7/2016', '10', '15/5/2017', '30.94', 'N'],
['T103', '15/11/2016', '94', '13/6/2017', '83.16', 'Y'],
['T104', '25/4/2017', '58', '10/1/2017', '25.08', 'N'],
['T105', '24/5/2017', '5', '20/6/2017', '93.8', 'Y']]
I want to be able to create a csv file and put in each list into every line ,how do I do it ? In addition ,I want to be able to overwrite the data with a new one whenever ,the list is updated ,how can I do this? Thanks
As of now ,here is the code I have:
with open(filepath + 'Bike_List_With_Service.csv','w',newline='') as file:
a=csv.writer(file,delimiter=',')
data=data
a.writerows(data)#write each line of data