1.上一篇聚類時碰到的問題ui
顯示這行讀取編碼問題:編碼
fr = open(filePath,'r+')spa
2.源碼添加了encoding=‘utf-8’code
好吧,人家就是說這個不行(沒仔細看報錯)utf-8
3.編碼給‘gbk’源碼
TypeError: an integer is required (got type str)class
4.終於反應過來要去查查open()require
open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
5.最後格式coding
fr = open(filePath,'r+',1,'gbk')file
成功讀出漢字了
2020-06-08