摘要: 基于win7 + python3.4 原文是py2环境,而我的环境是py3,所以对原代码做了修改:decode(), encode() 2016-06-16修改: 阅读全文
posted @ 2016-03-04 20:53 罗兵 阅读(37554) 评论(8) 推荐(5)
摘要: b = b"Hello, world!" # bytes object s = "Hello, world!" # str object print('str --> bytes') print(bytes(s, encoding="utf8")) print(str.encode(s)) # 默认 阅读全文
posted @ 2016-03-04 20:14 罗兵 阅读(28815) 评论(0) 推荐(0)