# bytes object b = b"example" # str object s = "example" # str to bytes bytes(s, encoding = "utf8") # bytes to str str(b, encoding = "utf-8") # an alternative method # str to bytes str.encode(s) # bytes to str bytes.decode(b)
本文标签:python str bytes 间的 转换
原文链接:
版权说明: 本文由作者上传,本站仅提供存储服务,转载请注明原文链接