PyQt5 – How to change the text of existing push button ?
In this article we will see how to change the text of existing push button. We know when we create a button, we set the text to it but sometimes, conditions occur in which re-usability of push button occur i.e button should do its normal operation just change the text of it, so it look different.
In order to do this we use
setText method. This method will over-write the existing text of push button.
Syntax : button.setText(new_text)
Argument : It takes string as argument.
Action performed : It over-write the text of button.