Решение проблемы:
class LogWin(QtWidgets.QMainWindow, Login):
def __init__(self):
super().__init__()
self.setupUi(self)
self.pushButton.pressed.connect(self.login)
def error(self):
QMessageBox.about(self, "Error", "Логин неверный.")
def login(self):
login = self.lineEdit.text()
response = requests.get('http://127.0.0.1:5000/login')
logins = response.json()['logins']
if login in logins:
self.hide()
self.window = Messenger(login = login)
self.window.show()
else:
self.error()
self.lineEdit.clear()
reg = QtWidgets.QApplication([])
regwin = LogWin()
regwin.show()
reg.exec()
class Messenger(QtWidgets.QMainWindow, Ui_MainWindow):
def __init__(self, login):
super().__init__()
self.setupUi(self)
self.label_3.setText(login)
self.label_3 = login
def start() не нужен