Python 基础知识整理-3 (bytes-strings)

strings 分别在 Python2、Python 3下 Python 2 将 strings 处理为原生的 bytes 类型,而不是 unicode,  Python 3 所有的 strings 均是 unicode 类型。     msg = '您好' # encode 将strings编码成bytes print(msg.encode('utf-8')) # decode 将bytes 解
相关文章
相关标签/搜索