I'm really kind of stuck here, and would really appreciate some help. I have a function that reads from a csv that can get quite large, and it will block some other routines from running in there allocated time slice. I need to make this code “non-blocking”. I think there might be a way to accomplish using the fnctl module, but I'm not sure how to implement it. The code is as follows:
def csv_parser(self):
# read and format csv to csv_data
try:
openfile = open(g.FS_TMP_TREND, "r")
reader = csv.reader(openfile, dialect='excel', delimiter="|")
for row in reader:
for i in range(12):
if row[i] == '':
v = 0
else:
v= float(row[i])
self.csvData[i].append(v)
self.csvWriteIndex += 1
except:
err = error_dialog(_('There was a problem loading csv data'))
err.show()
thank you for any help you can offer