标签:line enc nic err happy read codec position int
f = open("./data/test.txt","r") lines = f.readlines() for line in lines: print(line)
UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0xa6 in position 2729: illegal multibyte sequence 解决方案:
f = open("./data/happy.txt", "r", encoding=‘utf-8‘)
标签:line enc nic err happy read codec position int
原文地址:https://www.cnblogs.com/lucifer1997/p/12229733.html