python 二、python读取.htm文件报错:UnicodeDecodeError: 'utf8' codec can't decode byte 0xb3 in position 0的解决方法

问题是这样的:我用python写的程序去读取.htm文件中的数据,刚开始我用:fr = open("0.htm" , "r")时,程序运行后直接崩溃,后来根据提示的错误信息:ValueError encoding must be one of 'utf_8','big5', or 'gbk'.,所以我用codecs改写成以下形式:html - coding: utf-8 - import sys
相关文章
相关标签/搜索