self.label = QtWidgets.QLabel(self.centralwidget) self.label.setGeometry(QtCore.QRect(136, 70, 271, 71)) self.label.setAlignment(QtCore.Qt.AlignCenter) self.label.setObjectName("label") otherwindow.setCentralWidget(self.centralwidget) self.statusbar = QtWidgets.QStatusBar(otherwindow) self.statusbar.setObjectName("statusbar") otherwindow.setStatusBar(self.statusbar) self.retranslateUi(otherwindow) QtCore.QMetaObject.connectSlotsByName(otherwindow) def retranslateUi(self, otherwindow): _translate = QtCore.QCoreApplication.translate otherwindow.setWindowTitle(_translate("otherwindow", "MainWindow")) self.label.setText(_translate("otherwindow", "Welcom to this window")) if __name__ == '__main__': import sys app = QtWidgets.QApplication(sys.agrv) OtherWindow = QtWidgets.MainWindow() ui = Ui_otherwindow() ui.setupUi(OtherWindow) OtherWindow.show() app.exec_()