i got error while writing data to file
cannedham284 at hotmail.com
Mon Mar 13 13:45:53 EDT 2017
It seems I was a little too quick to hit "send". Option #2 of the two possible solutions I offered is not right. Here's what it should be (unless the formatting gets garbled):
with open('E:/amadown2py-master/reviews1.csv', 'r',encoding='UTF8') as csvfile:
with open('E:/amadown2py-master/Sam7_pos_rev.txt',mode='wt') as myfile:#Moved this!
mycsv = csv.reader(csvfile)
for row in mycsv:
data = row
score = ast.literal_eval(row)
if score > 3:
#myfile.close()#You shouldn't need this, bc you're using "with"
More information about the Python-list