python中编码(encode)解码(decode)讲解
一、python3中str与unicode在python3中,字符串有两种形式:str和bytes,两者区别如下:unicode string(str类型):以Unicode code points形式存储(人认识的形式)byte string(bytes类型):以byte形式存储(机器认识的形式)在python3中所定义的所有字符串都是unicode string类型,使用type和isinstance可以判别而bytes是一个二进制序列对象,你只要你在定义字符串时前面加一个b,就
原创
2020-07-03 17:58:07 ·
9156 阅读 ·
0 评论