Python学习之write 乱码

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u013985879/article/details/82534155
重点在于open 方法加上encoding="utf-8"
 with open("webrenren.html",'w',encoding="utf-8") as f:
        f.write(html)

猜你喜欢

转载自blog.csdn.net/u013985879/article/details/82534155