|
|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
- f = open("D:\\2018年高考理综选择题专项训练 (3).doc")
- questionall = []
- answerall = []
- for each_line in f:
- if every[:4] != "【答案】":
- (question, answer) = each_line.split("【, 。", 1)
- if question != "【答案】":
- questionall.append(question)
- if answer == "【答案】":
- answerall.append(answer)
- break
复制代码
错误原因:
C:\Users\Administrator\AppData\Local\Programs\Python\Python37\python.exe C:/Users/Administrator/Desktop/程序/1.py
Traceback (most recent call last):
File "C:/Users/Administrator/Desktop/程序/1.py", line 5, in <module>
for each_line in f:
UnicodeDecodeError: 'gbk' codec can't decode byte 0xb1 in position 5: illegal multibyte sequence
Process finished with exit code 1
|
|