转自http://www.cnblogs.com/arctique/p/5699620.html
出问题的代码:
if __name__ == '__main__':
fileHandler = open('../report.html', mode='r')
report_lines = fileHandler.readlines()
for line in report_lines:
print(line.rstrip())
解决代码:
if __name__ == '__main__': fileHandler = open('../report.html', mode='r', encoding='UTF-8') report_lines = fileHandler.readlines() for line in report_lines: print(line.rstrip())