How it works...
The sys module is imported as it supplies access to the command-line arguments stored in the sys.argv list. This is because every PyQt GUI application must have a QApplication object to provide access to information such as the application's directory, screen size, and so on, so that you create an QApplication object. To enable PyQt to use and apply command-line arguments (if any), you pass the command-line arguments while creating a QApplication object. You create an instance of MyForm and call its show() method, which adds a new event to the QApplication object's event queue. This new event is used to display all the widgets specified in the MyForm class. The app.exec_ method is called to start the QApplication object's ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access