decode()函数的作用是用作解码,encode()函数是用作编码。

decode函数以encoding指定的编码格式解码字符串,默认是字符串编码。
语法是:
str.decode(encoding='utf-8')

encode函数以encoding指定的编码格式编码字符串。
语法是:
str.encode(encoding)
encoding指定要使用的编码。

相关文章:

  • 2022-12-23
  • 2021-10-28
  • 2021-07-19
  • 2021-10-13
  • 2021-12-28
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-01
  • 2022-12-23
  • 2022-12-23
  • 2021-07-21
  • 2022-12-23
  • 2022-12-23
  • 2021-10-11
相关资源
相似解决方案