b = b"example"    # bytes object  
s = "example"     # str object  
sb = bytes(s, encoding = "utf8")    # str to bytes 
或者:sb = str.encode(s)             # str to bytes 
bs = str(b, encoding = "utf8")      # bytes to str  
或者:bs = bytes.decode(b)           #  bytes to str  

 

相关文章:

  • 2021-10-12
  • 2022-01-05
  • 2022-12-23
  • 2022-12-23
  • 2021-09-06
  • 2021-10-02
  • 2021-10-10
  • 2021-11-19
猜你喜欢
  • 2021-12-23
  • 2021-10-02
  • 2021-10-02
  • 2022-02-04
  • 2021-11-19
相关资源
相似解决方案