class MyGUI(QMainWindow): def __init__(self): super(MyGUI, self).__init__() uic.loadUi('Main.ui', self) self.show() self.pushButton.clicked.connect(self.login) self.pushButton_2.clicked.connect(self.attach_sth) self.pushButton_3.clicked.connect(self.send_mail) def login(self): pass def attach_sth(self): pass def send_mail(self): pass app = QApplication([]) windows = MyGUI() app.exec_()