网站首页 美食营养 游戏数码 手工爱好 生活家居 健康养生 运动户外 职场理财 情感交际 母婴教育 时尚美容

Python教程 encode()方法的使用

时间:2024-11-20 18:09:57

1、新建一个encode()方法的使用.py,如图所示:

Python教程 encode()方法的使用

3、encode() 方法的作用:指定字符串的编码,如图所示:

Python教程 encode()方法的使用

5、将 str1 的编码设置为utf-8,代码:st1r_utf8 = str1.encode("UTF-8");

Python教程 encode()方法的使用

7、至此,本教程结束!

© 2025 小知经验
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com