

setGeometry ( QRect ( 60, 0, 500, 20 )) # (60, 0) # create another frame for other set of checkbox self. btn1_click ) # selected value will be displayed on label self. move ( 0, 20 ) # push button to display output on label self. setChecked ( True ) # select by default self. top ) # create frame for a set of checkbox self. title ) # tGeometry(self.left, self.top, self.width, self.height) # use above line or below self. widget () def widget ( self ): # window setup self. _init_ () # inherit init of QWidget self. # qt5_ex.py import sys from PyQt5.QtWidgets import ( QApplication, QWidget, QLabel, QPushButton, QCheckBox, QFrame ) from PyQt5.QtCore import pyqtSlot, QRect class MainPage ( QWidget ): def _init_ ( self, title = " " ): super (). argv ) w = MainPage ( title = "PyQt5" ) sys. setText ( "Choose Yes or No" ) def main (): app = QApplication ( sys. setText ( "You pressed No" ) else : self. show () () def btn1_click ( self ): if self. radioBtn4 = QRadioButton ( "School", self. radioBtn3 = QRadioButton ( "College", self. setGeometry ( QRect ( 60, 0, 100, 20 )) # (60, 0) # create another frame for other set of radio button self.

top ) # create frame for a set of radio button self. # qt5_ex.py import sys from PyQt5.QtWidgets import ( QApplication, QWidget, QLabel, QPushButton, QRadioButton, QFrame ) from PyQt5.QtCore import pyqtSlot, QRect class MainPage ( QWidget ): def _init_ ( self, title = " " ): super (). setText ( "Button is pressed in Frame 2" ) def main (): app = QApplication ( sys. setText ( "Button is pressed in Frame 1" ) () def btn2_click ( self ): self. show () () def btn1_click ( self ): self. btn2_click ) # selected value will be displayed on label self. move ( 0, 50 ) # location of btn relative to frame2 self. setGeometry ( QRect ( 40, 150, 250, 80 )) # push button to display output on label self. setGeometry ( QRect ( 0, 20, 500, 20 )) # create frame for a set of checkbox self. frame1, text = "Submit" ) # location of btn relative to frame2 i.e. setGeometry ( QRect ( 40, 40, 250, 80 )) # push button to display output on label self. quit () def main (): app = QApplication ( sys. setText ( "Submit button is pressed " ) () def exit_window ( self ): QCoreApplication. show () () def change_label ( self ): self. btn2 = QPushButton ( self, text = "Close" ) self. setToolTip ( "Change value of label" ) self.

btn1 = QPushButton ( self, text = "Submit" ) self. setWordWrap ( True ) # allow word-wrap # add button self. label1 = QLabel ( self, text = "Hello World! \n Welcome to PyQt5 Tutorial" ) # margin: left, top width, height self. # qt5_ex.py import sys from PyQt5.QtWidgets import ( QApplication, QWidget, QLabel, QPushButton ) from PyQt5.QtCore import pyqtSlot, QRect, QCoreApplication class MainPage ( QWidget ): def _init_ ( self, title = " " ): super (). show () def main (): app = QApplication ( sys. setWordWrap ( True ) # allow word-wrap self. # qt5_ex.py import sys from PyQt5.QtWidgets import ( QApplication, QWidget, QLabel ) from PyQt5.QtCore import QRect class MainPage ( QWidget ): def _init_ ( self, title = " " ): super ().
