t = input("文件:")
r = open(t,"r")
for line in r.readlines():
print(line)
r.close()
故障提示
Traceback (most recent call last):
File "C:/Users/HEZB/AppData/Local/Programs/Python/Python39/文件读写.py", line 3, in
for line in r.readlines():
UnicodeDecodeError: 'gbk' codec can't decode byte 0xad in position 8: illegal multibyte sequence