Python PyQt5 BUTTONS are easy! 🛎️

Published: 26 July 2024
on channel: Bro Code
4,691
124

#pythontutorial #python #pythonprogramming
#Python PushButtons
import sys
from PyQt5.QtWidgets import QMainWindow, QApplication, QPushButton, QLabel

class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.setGeometry(700, 300, 500, 500)
self.button = QPushButton("Click me!", self)
self.initUI()

def initUI(self):
self.button.setGeometry(150, 200, 200, 100)
self.button.setStyleSheet("font-size: 30px;")
self.button.clicked.connect(self.on_click)

def on_click(self):
print("Button clicked!")

if _name_ == '__main__':
app = QApplication(sys.argv)
window = MainWindow()
window.show()
sys.exit(app.exec_())


Watch video Python PyQt5 BUTTONS are easy! 🛎️ online without registration, duration hours minute second in high quality. This video was added by user Bro Code 26 July 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 4,691 once and liked it 124 people.