PySide2 莫名报错
如图 F5 运行后,抛出一行错误但窗口创建正常
请问怎样解决这个错误?
代码:
from PySide2.QtWidgets import QApplication,QMainWindow,QPushButton,QPlainTextEdit,QMessageBox
from PySide2.QtUiTools import QUiLoader
from PySide2.QtCore import QFile
from PySide2.QtGui import QIcon
from sys import exit
class Codec_interface:
def __init__(self):
codecwindow = QFile(r'C:\Users\Administrator\Desktop\jsr\程序及数据\ui文件\这是一个测试的ui文件.ui')
codecwindow.open(QFile.ReadOnly)
codecwindow.close()
self.ui = QUiLoader().load(codecwindow)
app = QApplication([])
codec =Codec_interface()
codec.ui.show()
exit(app.exec_)
是這个吧...