语法错误:“ charmap”编解码器无法解码字节

时间:2019-01-12 22:39:42

标签: python python-2.7 character-encoding syntax-error pyqt4

配置cp1252的编码以配置一些序列,例如“〜'^”,例如,当我输入编码:utf-8文本格式错误的字符串时,我已经使用“ latin-1”和相同的错误进行了测试继续。

如果再次将“ cp1252”编辑为“ cp1252”,则可以正常打开它,但是当我关闭并稍后打开文件时,错误消息又回来了。 有人知道如何解决以下错误,但总是会执行主脚本文件。 SyntaxError: 'charmap' codec can't decode byte 0x81 in position 45: character maps to <undefined>

# coding: cp1252

import sys
import os
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from ytconsole import *

self.msgt2 =QMessageBox()
self.msgt2.setIcon(QMessageBox.Information)
self.msgt2.setWindowTitle('Python Youtube Downloader') -->[Here is the problem] line 353
self.msgt2.setText("{} arquivos MP4 foram baixados, salvos na Área de Trabalho".format(int(l)))``

0 个答案:

没有答案