Reference:
https://www.jianshu.com/p/5511cb3bdbb1
https://www.cnblogs.com/cloud-ken/p/8432999.html
https://www.cnblogs.com/unnameable/p/7366437.html
Write CSV
Import CSV
Write csv
line1=['Patients','Age']
c01= ['01',23]
c02 = ['02',24]
out=open('each.csv','a',newline='')
csv_write=csv.writer(out,dialect='excel')
csv_write.writerow(line1)
csv_write.writerow(c01)
csv_write.writerow(c02)
print ("write over")
Read CSV
csv_file=csv.reader(open('each.csv','r'))
print(csv_file)
for line in csv_file:
print(line)
Further, it may also be used to read csv pandas