问题出在编码方式上:encoding不是用 utf-8, 使用 utf-8-sig f = open(r'a.txt', encoding='utf-8-sig') 如果用utf-8,readlines读出来的列表就会是这样: ['\ufeff示例\n'] Read More
posted @ 2020-08-09 09:23 程序法 Views(547) Comments(0) Diggs(0) Edit