读取文件用的编码不对。open方法中加上encoding参数设置下读取文件的编码即可
open(r'HLM.txt', 'r', encoding='utf-8') 或者 open(r'HLM.txt', 'r', encoding='gbk')