解決方法指定編碼encoding='utf-8', errors='ignore'
with open(cfgfile+'.in','r', encoding='utf-8', errors='ignore') as f: for line in f.readlines(): pring(line)