The following piece of code creates a CSV file, but every other line is blank. How can I prevent these linebreaks from happening?
import datetime
import time
import csv
i = 0
while i < 10:
TempProbe = "78.12"
CurrentTime = time.strftime("%x")
CurrentDate = time.strftime("%I:%M:%S")
stringAll = TempProbe + "," + CurrentTime + "," + CurrentDate
print(stringAll)
file = open("outFile.csv", "a")
csvWriter = csv.writer( file )
csvWriter.writerow( [TempProbe, CurrentTime,CurrentDate] )
file.close()
i = i + 1
time.sleep(1)