import csv
def save2csv(Timestamp, RealValue, i):
with open(r'E:/wf/'+ file[i][-13:],'a+',newline='',encoding='utf_8_sig') as csvfile:
writer = csv.writer(csvfile)
for i in range(len(data)):
writer.writerow([Timestamp[i], RealValue[i]])