from PyQt5.QtWidgets import QApplication, QButtonGroup, QRadioButton, QVBoxLayout, QWidget app = QApplication([]) window = QWidget() layout = QVBoxLayout() radio_button_group = QButtonGroup() radio_button1 = QRadioButton("Option 1") radio_button_group.addButton(radio_button1) layout.addWidget(radio_button1) radio_button2 = QRadioButton("Option 2") radio_button_group.addButton(radio_button2) layout.addWidget(radio_button2) radio_button3 = QRadioButton("Option 3") radio_button_group.addButton(radio_button3) layout.addWidget(radio_button3) def on_radio_button_clicked(id): print("Button {0} clicked".format(id)) radio_button_group.buttonClicked.connect(on_radio_button_clicked) window.setLayout(layout) window.show() app.exec()In this example, we create a QVBoxLayout to contain our radio buttons. We then create a QButtonGroup to group our radio buttons together, so that only one can be selected at a time. We create three QRadioButtons, and add them to our layout and button group. We then connect our buttonClicked signal to a function on_radio_button_clicked, which will be called whenever any of our radio buttons are clicked. When the user clicks one of the radio buttons, our on_radio_button_clicked function will be called with the id of the button that was clicked. This allows us to determine which button was clicked, and take whatever action we need to based on the user's selection. Package: PyQt5.