Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
Create Python checkboxes in 5 minutes! โœ…
Play lesson

Python tutorial for beginners ๐Ÿ - Create Python checkboxes in 5 minutes! โœ…

4.0 (0)
8 learners

What you'll learn

This course includes

  • 14.3 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

#pythontutorial #python #pythonprogramming # PyQt5 Checkboxes import sys from PyQt5.QtWidgets import QApplication, QMainWindow, QCheckBox from PyQt5.QtCore import Qt class MainWindow(QMainWindow): def __init__(self): super().__init__() self.setGeometry(700, 300, 500, 500) self.checkbox = QCheckBox("Do you like food?", self) self.initUI() def initUI(self): self.checkbox.setGeometry(10, 0, 500, 100) self.checkbox.setStyleSheet("font-size: 30px;" "font-family: Arial;") self.checkbox.stateChanged.connect(self.checkbox_changed) def checkbox_changed(self, state): if state == Qt.Checked: print("You like food") else: print("You DO NOT like food") if ___name___ == '__main__': app = QApplication(sys.argv) window = MainWindow() window.show() sys.exit(app.exec_())

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere