python 3.5 報錯TypeError:can't concat str to bytes 、TypeError: write() argument must be str, not bytes

原程序: out = open('train_data.txt', 'w') for sentence in sentences: out.write(sentence.encode("utf-8")+"\n") print("done!") 報錯:TypeError:can't concat str to byteshtml 修改成:python out.write(sentence.e
相關文章
相關標籤/搜索