Python3 编码

# 交互式编码
# Python3 的字符串使用Unicode,但最常用的编码就是utf-8,下面给出交互式修改编码的方法
s = 'Python-中文'
print(s)
b = s.encode('utf-8')
print(b)
print(b.decode('utf-8'))

  

 

posted @ 2019-02-25 16:23  因为专注。所以专业  阅读(97)  评论(0编辑  收藏  举报