I have a problem converting an .act file to csv format. I am using this code:
import struct
import csv
DATA = []
with open("modis_lst.act", "rb") as actFile:
for _ in range(256):
raw = actFile.read(3)
color = struct.unpack("3B", raw)
DATA.append(color)
with open('test.csv', 'wb') as csvfile:
csvWriter = csv.writer(csvfile)
csvWriter.writerows(DATA)
but I get the following ERROR: a bytes-like object is required, not 'str'