with open('file.txt','w+') as f: f.write(content)
content =‘要放入文件的内容’ ;要进行utf-8转码,可在pycharm中打开文件进行转码