mercredi 24 février 2021

Why my if else statement is not working in pyqt5 qlinedit [duplicate]

    if self.function1.text() != '01' or '02' or '03' or '04':
        self.enable1.setCheckable(False)
        self.messageBox.setIcon(self.messageBox.Warning)
        self.messageBox.setWindowTitle("Duration Error")
        self.messageBox.setText("Function Code should be 01 or 02 or 03 or 04!")
        self.messageBox.show()
    else:
        self.enable1.setCheckable(True)

This is not working in pyqt5. There is any other solution?

Aucun commentaire:

Enregistrer un commentaire