python 读文件,跳过有问题的那行
报错:
UnicodeDecodeError: 'gbk' codec can't decode byte 0xfa in position 4781: illegal multibyte sequence
解决方案:
f = open("20091012134152.txt", encoding="gbk", mode="r")
改成
f = open("20091012134152.txt", encoding="gbk", mode="r", errors="ignore")