UnicodeEncodeError: ‘ascii’ codec can’t encode characters in position 0-4: ordinal not in range(128)
解决方法:
一、大众方法
网上很多方法在python文件头添加几行代码如下所示:
二、简单方法
直接使用str()函数,例如:
三、字符编码解码
编码根据实际情况进行修改:
更多有趣的实用技术,请查看对应的专栏。
官网首页:http://www.52014991.xyz/home.html
福利实惠:http://www.52014991.xyz/contact.html
功能jar包:http://www.52014991.xyz/products.html
代码主页:https://github.com/YouAreOnlyOne?tab=repositories
团队成员:http://www.52014991.xyz/team.html
更多干货资源请关注作者的专栏。
留言点赞关注,我们一起分享AI学习与发展的干货。