Qt Designer ui转换成python 后的调用使用使用py执行运行

假设你导出的文件名是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_())

 

Author: 90cg