Python3 讀取文件內容的時候出錯:python
for line in f.readlines():code
UnicodeDecodeError: 'gbk' codec can't decode byte 0x8e in position 8: illegal multibyte sequenceutf-8
這個時候給open添加一個參數便可it
with open('/userList.txt', 'rt', encoding='utf-8') as f: