Código:
import sys from PyQt4 import QtCore, QtGui from ui import Ui_ventana class principal (QtGui.QMainWindow): def __init__(self): self.setupUI() self.connectUi() self.show() sys.exit(self.app.exec_()) def setupUI(self): self.app=QtGui.QApplication(sys.argv) QtGui.QMainWindow.__init__(self) self.venta=Ui_ventana() self.venta.setupUi(self) def connectUi(self): dato = 2 self.venta.texto.setText(dato) if __name__ == '__main__': principal()