码迷,mamicode.com
首页 > 编程语言 > 详细

【Rollo的Python之路】Python 编码与解码

时间:2019-06-01 21:43:08      阅读:98      评论:0      收藏:0      [点我收藏+]

标签:class   python 编码   test   utf8   read   print   color   open   编码   

Python 编码与解码:

1.0 解码:encoding = ‘utf-8/utf8/UTF-8/UTF8‘,要想解码,必须知道用什么方式编码的。

with open(test,r,encoding = utf-8) as e:
    print(e.read())

 

【Rollo的Python之路】Python 编码与解码

标签:class   python 编码   test   utf8   read   print   color   open   编码   

原文地址:https://www.cnblogs.com/rollost/p/10960987.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!