This is the code repository for Mastering GUI Programming with Python, published by Packt.
Develop impressive cross-platform GUI applications with PyQt
PyQt5 has long been the most powerful and comprehensive GUI framework available for Python, yet there is a lack of cohesive resources available to teach Python programmers how to use it. This book aims to remedy the problem by providing comprehensive coverage of GUI development with PyQt5.
This book covers the following exciting features:
- Get to grips with the inner workings of PyQt5
- Learn how elements in a GUI application communicate with signals and slots
- Learn techniques for styling an application
- Explore database-driven applications with the QtSQL module
- Create 2D graphics with QPainter
- Delve into 3D graphics with QOpenGLWidget
- Build network and web-aware applications with QtNetwork and QtWebEngine
If you feel this book is for you, get your copy today!
All of the code is organized into folders. For example, Chapter03.
The code will look like the following:
# inside __init__()
self.goodbutton = qtw.QPushButton("Good")
self.layout().addWidget(self.goodbutton)
self.goodbutton.clicked.connect(self.no_args)
# ...
def no_args(self):
print('I need no arguments')
Following is what you need for this book: This book is for programmers who want to create attractive, functional, and powerful GUIs using the Python language. You’ll also find this book useful if you are a student, professional, or anyone who wants to start exploring GUIs or take your skills to the next level. Although prior knowledge of the Python language is assumed, experience with PyQt, Qt, or GUI programming is not required.
With the following software and hardware list you can run all code files present in the book (Chapter 1-17).
Chapter | Software required | OS required |
---|---|---|
1 - 17 | Python 3.7 or greater, PyQt 5.12 | Windows, Mac OS X, and Linux (Any) |
17 | PyInstaller 3.4, SetupTools 41.0.1 | Windows, Mac OS X, and Linux (Any) |
1-4 | QtDesigner/QtCreator 4.8.0 or higher | Windows, Mac OS X, and Linux (Any) |
9 | SQLite 3 | Windows, Mac OS X, and Linux (Any) |
12, 14 | psutil 5.6.2 | Windows, Mac OS X, and Linux (Any) |
15 | Raspberry Pi 3B+, Raspbian 10 | Windows, Mac OS X, and Linux (Any) |
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. Click here to download it.
Click on the following link to see the Code in Action: Click here to view the videos
Page 77: The section of code that describes the "on_category_change" method:
- Line 3 reads, "dialog = CategoryWindow()", it should read, "self.dialog = CategoryWindow()"
- Line 4 reads, "dialog.submitted.connect(self.add_category)", it should read, "self.dialog.submitted.connect(self.add_category)"
Page 418:
- Here is the
=__init__()
method should be Here is the__init__()
method
Page 419:
- The
mousePressEvent())
method is called should be ThemousePressEvent()
method is called
Alan D Moore is a data analyst and software developer who has been solving problems with Python since 2006. He's developed both open source and private code using frameworks like Django, Flask, Qt, and, Tkinter, and contributes to various open source Python and Javascript projects. Alan is the author of Python GUI Programming with Tkinter.
Python GUI programming with Tkinter
Click here if you have any feedback or suggestions.
If you have already purchased a print or Kindle version of this book, you can get a DRM-free PDF version at no cost.
Simply click on the link to claim your free PDF.