当前位置:主页 > 软件编程 > Python代码 >
时间:2021-05-08 09:05:02 | 栏目:Python代码 | 点击:次
实例如下:
#encoding=utf-8 content=u"广东松炀再生资源股份有限" content=content.encode("utf-8")#写入的文件编码格式为utf-8 with open("testbianma.txt","w")as f: f.write(content)