You can download this code by clicking the button below.
This code is now available for download.
This code creates a PyQt5 application containing a button. When the button is clicked, a label is displayed showing the text 'Button Clicked!'
Technology Stack : PyQt5
Code Type : PyQt5 GUI Application
Code Difficulty : Intermediate
import random
from PyQt5.QtWidgets import QApplication, QPushButton, QLabel
def random_button_click():
app = QApplication([])
window = QPushButton('Click Me!', parent=None)
window.clicked.connect(lambda: QLabel('Button Clicked!', parent=None).show())
window.show()
app.exec_()