I have following code writing CSV data to a file
with open('data-file.csv','wb') as myfile:
wrtr = csv.writer(myfile, delimiter=',', quotechar='"')
data = [time.strftime('%H:%M:%S'),int(round((value2 - value) / 1, 2))]
wrtr.writerow(data)
I am retrieving below error, I tried to solve it but I am unable
wrtr.writerow(data)
TypeError: a bytes-like object is required, not 'str'