sketch.py #--*-- coding:utf-8 --*-- import pickle import nester man = [] other = [] try: data = open ("datafile.txt") for each_line in data: try: (role, line_spoken) = each_line.split(":", 1) line_spoken = line_spoken.strip() if role =…
会报错: UnicodeDecodeError: 'ascii' codec can't decode byte 0xa0 in position 3: ordinal not in range(128) 解决办法是添加encoding参数: pickle.load(f, encoding='iso-8859-1') 就能解决了…