f=open('file.txt','w+',encoding='utf-8') f.write('practice makes perfect.\n熟能生巧。\nDoing is better than saying\n' '行胜于言.')
这样就不会报错,你试试看