数据类型转换

1 msg = 我是中国人
2 
3 print(msg)
4 
5 转换二进制
6 print(msg.encode(encoding='utf-8'))
7 转回来
8 
9 print(msg.encode(encoding='urf-8').decode(decoding=''utf-8))

 

 

posted @ 2017-12-25 21:56  Bo_Liu  阅读(113)  评论(0编辑  收藏  举报