这部分写的是关于python中的编码的转换
#Author:wqh
#定义一个变量
msg = "某某人"
#输出变量
print(msg)
#打印msg的类型
print(type(msg))
#打印变量,并且把str类型转换成bytes类型
print(msg.encode(encoding="utf-8"))
#此处将bytes类型在转换为str的类型
print(msg.encode(encoding="utf-8").decode(encoding="utf-8"))
这部分东西,金角大王的博客讲的非常的详细,感谢大佬的分享,地址在这里:http://www.cnblogs.com/alex3714/articles/7550940.html