def __init__(self): app = QtWidgets.QApplication(sys.argv) self.MainWindow = QtWidgets.QMainWindow() self.ui = Ui_MainWindow() self.ui.setupUi(self.MainWindow) self.MainWindow.setWindowTitle('PyQt5 GUI') # change window title self.MainWindow.show() sys.exit(app.exec_())
def __init__(self): app = QtWidgets.QApplication(sys.argv) self.MainWindow = QtWidgets.QMainWindow() self.ui = Ui_MainWindow() self.ui.setupUi(self.MainWindow) self.update_widgets() self.MainWindow.show() sys.exit(app.exec_())
def __init__(self): app = QtWidgets.QApplication(sys.argv) self.MainWindow = QtWidgets.QMainWindow() self.ui = Ui_MainWindow() self.ui.setupUi(self.MainWindow) self.MainWindow.setWindowTitle('PyQt5 GUI') # use: self.MainWindow self.ui.pushButton.setText( 'New Button text') # use: self.ui to access widgets self.MainWindow.show() sys.exit(app.exec_())
from PyQt5 import QtWidgets from Designer_code.Video3_First_Design import Ui_MainWindow if __name__ == "__main__": import sys app = QtWidgets.QApplication(sys.argv) MainWindow = QtWidgets.QMainWindow() ui = Ui_MainWindow() ui.setupUi(MainWindow) MainWindow.show() sys.exit(app.exec_())