decode and encode

python学习网 2017-12-10 14:09:02

msg = "我爱北京天安门"
print(msg)
print(msg.encode())
print(msg.encode().decode())

#  decode()  就是把 byte类型转化位其他格式 一般都是utf -8

#encode()  就是把其他格式转化为byte类型的二进制格式

 

阅读(753) 评论(0)