tubeshowcase●1,194,391 videos♡ My collection 0
← Learn to Code

Learn to Code07:05

Create Python buttons in 7 minutes! 🛎️

Bro Code ↗

From the creator

#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_())

Published 2024-07-26 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.

Keep exploring Learn to Code