python str与bytes之间的转换
python str与bytes之间的转换# bytes objectb = b"example"# str objects = "example"# str to bytessb = bytes(s, encoding = "utf8")# bytes to strbs = str(b, encoding = "utf8")# an alternative method# str to bytessb2 = str.encode(s)# bytes to strbs2 = .
复制链接