Python PyQt5 BUTTONS are easy! 🛎ïļ

āđāļŠāļĢāđŒ
āļāļąāļ‡
  • āđ€āļœāļĒāđāļžāļĢāđˆāđ€āļĄāļ·āđˆāļ­ 16 āļ•.āļ„. 2024
  • #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_())

āļ„āļ§āļēāļĄāļ„āļīāļ”āđ€āļŦāđ‡āļ™ • 8

  • @BroCodez
    @BroCodez  2 āļŦāļĨāļēāļĒāđ€āļ”āļ·āļ­āļ™āļāđˆāļ­āļ™ +1

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

  • @CourageCatalyst11
    @CourageCatalyst11 2 āļŦāļĨāļēāļĒāđ€āļ”āļ·āļ­āļ™āļāđˆāļ­āļ™ +1

    i think you should make a whole university man, your channel is full of years of programming science

  • @IosebiGames
    @IosebiGames 2 āļŦāļĨāļēāļĒāđ€āļ”āļ·āļ­āļ™āļāđˆāļ­āļ™ +1

    Can't wait for 2 Milion subscribers!

  • @pradeeppardeep1943
    @pradeeppardeep1943 2 āļŦāļĨāļēāļĒāđ€āļ”āļ·āļ­āļ™āļāđˆāļ­āļ™

    You are too good..

  • @thedogecraftolda
    @thedogecraftolda 2 āļŦāļĨāļēāļĒāđ€āļ”āļ·āļ­āļ™āļāđˆāļ­āļ™

    please make a video on qml and python

  • @aye9449
    @aye9449 2 āļŦāļĨāļēāļĒāđ€āļ”āļ·āļ­āļ™āļāđˆāļ­āļ™

    nice

  • @alvinamana1459
    @alvinamana1459 29 āļ§āļąāļ™āļ—āļĩāđˆāļœāđˆāļēāļ™āļĄāļē

    NGL after the __int__ was cool but didn't make real world sense.This opened up my eyes how to how you can use magic methods and others methods like that

  • @chukwuebukauche-uchegbu6697
    @chukwuebukauche-uchegbu6697 2 āļŦāļĨāļēāļĒāđ€āļ”āļ·āļ­āļ™āļāđˆāļ­āļ™

    how old are you?