def home(self): from home import Ui_home self.window = QtWidgets.QMainWindow() self.ui=Ui_home() self.ui.setupUi(self.window) self.window.show() #MainWindow.hide() self.window.show()
self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow) def retranslateUi(self, MainWindow): _translate = QtCore.QCoreApplication.translate MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow")) self.label_2.setText(_translate("MainWindow", "MOOD")) self.label_4.setText(_translate("MainWindow", "Playlists for you")) self.pushButton.clicked.connect(self.home) self.pushButton_2.clicked.connect(self.search) self.pushButton_8.clicked.connect(self.settings) self.pushButton_6.clicked.connect(self.cplaylist) self.pushButton_3.clicked.connect(self.upload) self.pushButton_7.clicked.connect(self.workout) self.pushButton_13.clicked.connect(self.hiphop) self.pushButton_12.clicked.connect(self.rock) self.pushButton_11.clicked.connect(self.sad) self.pushButton_14.clicked.connect(self.party) self.pushButton_10.clicked.connect(self.romantic) self.pushButton_5.clicked.connect(self.uplaylist) if __name__ == "__main__": import sys app = QtWidgets.QApplication(sys.argv) MainWindow = QtWidgets.QMainWindow() ui = Ui_home() ui.setupUi(MainWindow) MainWindow.show() sys.exit(app.exec_())