bytes二进制文件类型
更新:HHH   时间:2023-1-7


msg = "我爱你"
print(msg.encode(encoding='utf-8')) #转成bytes类型文件 编码
print(msg.encode(encoding="utf-8").decode(encoding="utf-8")) #转回str字符串类型 先编码-->解码

string --> bytes encode编码

bytes --> string decode解码

返回编程语言教程...