a=[] b=[] for i in range(len(predicted)): b.append((int)(float(predicted[i]))) a.append(int(test_set.label[i][0])) f=open('F:/goverment/ArticleMining/predict.txt', 'w') for i in range(len(predicted)): f.write(str(b[i])) f.write('\n') f.write("写好了") f.close()