import sys
from PyQt5.QtWidgets import *
class Example(QWidget):
def __init__(self):
super().__init__()
self.resize(180, 40)
self.setWindowTitle("Пример")
self.button = QPushButton('изменить надпись нижней кнопки', self)
self.button.clicked.connect(self.function)
self.button_2 = QPushButton('Hello user!', self)
self.button_2.setGeometry(0, 20, 180, 25)
def function(self):
self.button_2.setText("Привет пользователь!")
def main():
app = QApplication(sys.argv)
window = Example()
window.show()
sys.exit(app.exec_())
if __name__ == '__main__':
main()