
This video will give you an overview about the course.
We wish to improve our Python programming skills by learning how to develop GUIs.
• We import the Tkinter framework
• We create a Tkinter class instance
• We start the main window event loop
We have a running Tkinter GUI and now we want to add widgets to it.
• From Tkinter, we import ttk
• We use ttk to create widgets
• We create event handling for our widgets
We like to have better control over how we align our widgets within our GUI.
• We use the grid layout manager
• We learn different ways to lay out widgets
• We explore more of the available grid properties
We want to enter and read back text from within our GUI.
• We use the ttk entry widget
• We create instances of Tkinter StringVar
• We bind StringVar to the entry and use get
We would like to add menus with menu items to our GUI.
• From Tkinter, we import the menu class
• We use menu to create the menu bar and menus
• We create functions to make the items functional
We wish to organize our GUI to hold many widgets. We want these widgets to be grouped by related functionality areas.
• We create a ttk notebook
• We create ttk frames and label frames
• We place those frames as tabs onto our notebook
We want to store data in a Python structure and then display the data in a GUI widget.
• We use a Python list comprehension to create the data
• We create a ttk combo box widget
• We assign the data list values to the combo box
We would like to make our GUI more interesting looking by displaying images in the GUI.
• We create a ttk button
• We assign a gif image file to the button
• We display an icon file in the GUI window title
We want to make our GUI more functional by adding many different widgets to it.
• We create a ttk progress bar and buttons
• We write callback functions
• We call the functions to update the progress bar
We want to apply the benefits of programming object-oriented to our GUI.
• We create a Python class
• We refactor all our code into the class
• We transform functions into methods
We want to test our GUI in an automated fashion.
• We import our GUI class and Python’s unit test framework
• We programmatically invoke methods and read class attributes
• We inherit from unit test Testcase and use assertEqual
We want to create GUIs using the PyQt5 framework for Python.
• We install PyQt5
• We import required packages from PyQt5
• We create our first GUI using PyQt5
We want to visually design our GUIs in PyQt5.
• We install the PyQt5 tool set
• We find the designer executable in the installation folder
• We launch the Qt Designer tool and visually design GUIs
We would like to use the designer generated UI code in our Python code.
• We use the pyuic5 tool for conversion
• We run the converted Python code
• We import the UI Python code into our own modules
We want to extend the UI-designed functionality with our own Python code.
• We import the UI Python code into a module
• We refactor our module into a class
• We add new functionality in our own class methods
We want our GUI to do actions. We have a UI design and it runs but it does not do much yet.
• We access all UI widgets in our own class
• We write methods that have actions
• We connect the methods to our widgets via triggers
We want to make our GUIs look great.
• We use Qt Designer style sheets
• We apply stylesheets to widget classes
• We apply stylesheets to the entire GUI
We want to understand PyQt5’s event-handling mechanizm.
• We use Qt Designer’s edit signals/slots mode
• We connect signals to slots in the designer
• We create our own, custom slots
We would like to invoke different methods from the same widget depending upon user selection.
• We call disconnect before calling connect
• We use try…except code to catch exceptions
• We programmatically click widgets and find workarounds
Sometimes, our PyQt5 GUI almost mysteriously does not show up or crashes and we see no error output in the console.
• We create a reusable module using sys.excepthook
• We import the excepthook module into our code
• We save the exceptions and print them to the console
We want to distribute our Python GUI to other computers that do not have Python and PyQt5 installed.
• We install the PyInstaller
• We turn our Python modules into executables
• We add conversation capabilities to our GUI
We want to add networking capabilities to our GUI.
• We create a QTcpServer and QTcpSocket class module
• We import the networking module
• We create a TCP/IP server and clients
We want to work with SQL databases within our GU. We want to create a database and update it.
• We import Python’s sqlite3 and PyQt5’s QtSql modules
• We create an SQLite database within our GUI
• We view the data with a PyQt5 table view widget
One cannot ignore the benefits of a well-designed architecture and graphical user interface for applications. If you're interested in designing and building graphical user interfaces that are functional, appealing, and user-friendly using one of the most powerful languages, Python 3. This course is for you. It is meant for intermediate level programmers who want to enhance their skills by developing GUIs written in Python.
In the initial part of the course, you will learn the important programming concepts of Python; we also teach you how to create applications step-by-step. You will be using popular GUI frameworks (PyQt5 and Tkinter) to build GUI applications. You will create cross-platform applications, that you build once and deploy everywhere.
You will learn how to create GUI forms and widgets and arrange them using layout managers. We will also look into how to connect our GUIs to networks and databases.
By the end of this course, you will have successfully mastered high-end GUI application such as Card Game and Paint App and will be capable of building many more powerful, cross-platform, and scalable applications.
About the Author
Burkhard Meier is a professional software test automation designer, developer, and analyst. He has more than 18 years' professional experience working for several software companies in California, USA.
In his professional career, he developed advanced in-house testing frameworks written in Python 3. He also developed advanced test automation GUIs in Python, which highly increased the productivity of the software development testing team.
When not dreaming in Python code, he reads programming books about design, likes to go for long walks, and reads classical poetry.