假设你导出的文件名是90CG
import sys,pdb from PyQt4 import QtCore, QtGui import 90CG class TestWnd(QtGui.QMainWindow,90CG.Ui_MainWindow): def __init__(self, parent=None): super(TestWnd, self).__init__(parent) wnd = self.setupUi(self) def mywindow(): mywindow = TestWnd() mywindow.show() return mywindow app = QtGui.QApplication( sys.argv ) myobj = mywindow() sys.exit(app.exec_())