Create a directory named advanced_course_qt. We can put all of our tutorial files here. Name the first script button_and_label.py and use the following code to create a button and a label for that button (refer to the code file on the following GitLab link for the full code: https://gitlab.com/arjunaskykok/hands-on-blockchain-for-python-developers/blob/master/chapter_09/advanced_course_qt/button_and_label.py):
from PySide2.QtWidgets import QWidget, QApplication, QLabel, QPushButton, QVBoxLayoutfrom PySide2.QtCore import Qtimport sysclass ButtonAndLabel(QWidget):......if __name__ == "__main__": app = QApplication(sys.argv) button_and_label = ButtonAndLabel() button_and_label.show() sys.exit(app.exec_())
Run the preceding ...