textbox()为啥报错啊
>>>file = open(r'C:\Users\Administrator\Desktop\h.txt')>>>eg.textbox(msg='文件【h.txt】的内容如下:',title=' ',text=file.read())
Traceback (most recent call last):
File "<pyshell#43>", line 1, in <module>
eg.textbox(msg='文件【h.txt】的内容如下:',title=' ',text=file.read())
UnicodeDecodeError: 'gbk' codec can't decode byte 0x8a in position 8: illegal multibyte sequence 编码问题,
file = open(r'C:\Users\Administrator\Desktop\h.txt', encoding='utf-8') # 使用 utf-8 编码打开 open(r'C:\Users\Administrator\Desktop\h.txt',encoding = "utf8")
页:
[1]