1. 关于编码错误:
报错:'gbk' codec can't decode byte 0xbb in position 18: illegal multibyte sequence
原因:读入的文本采用的是gbk编码,需要转换成python能识别的编码,比如utf-8
修改后能够成功运行。
2. 程序运行时出现 KeyboardInterrupt 错误。
报错:KeyboardInterrupt
没有找到什么原因,出现错误的代码中应用了filter函数,
其中,判断函数原本为:(此处报错KeyboardInterrupt)
不使用lambda表达式写,改为下图这样后,运行通过。(很懵逼,不知道是为啥????)