python基础:字符串编码与解码

 时间:2024-10-12 16:17:44

1、打开Python3.7交互界面

python基础:字符串编码与解码

2、定义字符串变量str = 'this is a encode and decode test'

python基础:字符串编码与解码

3、用encode()方法进行GBK编码newStr = str.encode('GBK')

python基础:字符串编码与解码

4、打印输出

python基础:字符串编码与解码

5、同时我可以对newStr进行解码newStr.decode('AsCII')

python基础:字符串编码与解码
  • python的字符串内建函数2
  • python中如何获得字符串的编码整数?
  • python检查编码方式chardet用法
  • python的字符串内建函数1
  • python的字符串内建函数12
  • 热门搜索
    手指饼干的做法 泰国用英语怎么说 晌怎么读 手滛过度怎么调理好 南瓜蛋糕的做法 水木娃娃十万个为什么 光遇怎么加好友 乔任梁为什么自杀 草莓印怎么快速消除 芜怎么读音