Book Image

Python GUI Programming with Tkinter, 2nd edition - Second Edition

By : Alan D. Moore
4.5 (2)
Book Image

Python GUI Programming with Tkinter, 2nd edition - Second Edition

4.5 (2)
By: Alan D. Moore

Overview of this book

Tkinter is widely used to build GUIs in Python due to its simplicity. In this book, you’ll discover Tkinter’s strengths and overcome its challenges as you learn to develop fully featured GUI applications. Python GUI Programming with Tkinter, Second Edition, will not only provide you with a working knowledge of the Tkinter GUI library, but also a valuable set of skills that will enable you to plan, implement, and maintain larger applications. You’ll build a full-blown data entry application from scratch, learning how to grow and improve your code in response to continually changing user and business needs. You’ll develop a practical understanding of tools and techniques used to manage this evolving codebase and go beyond the default Tkinter widget capabilities. You’ll implement version control and unit testing, separation of concerns through the MVC design pattern, and object-oriented programming to organize your code more cleanly. You’ll also gain experience with technologies often used in workplace applications, such as SQL databases, network services, and data visualization libraries. Finally, you’ll package your application for wider distribution and tackle the challenge of maintaining cross-platform compatibility.
Table of Contents (22 chapters)
19
Other Books You May Enjoy
20
Index
Appendices

What this book covers

Chapter 1, Introduction to Tkinter, introduces you to the basics of the Tkinter library and walks you through creating a basic Tkinter application. It will also introduce you to IDLE as an example of a Tkinter application.

Chapter 2, Designing GUI Applications, goes through the process of turning a set of user requirements into a design that we can implement.

Chapter 3, Creating Basic Forms with Tkinter and Ttk Widgets, shows you how to create a basic data entry application that appends entered data to a CSV file.

Chapter 4, Organizing Our Code with Classes, will introduce you to general object-oriented programming techniques as well as Tkinter-specific uses for classes that will make our GUI programs more maintainable and understandable.

Chapter 5, Reducing User Error with Validation and Automation, demonstrates how to automatically populate and validate data in our form's inputs.

Chapter 6, Planning for the Expansion of Our Application, familiarizes you with how to break a single-file script intelligently into multiple files, how to build a Python module that you can import, and how to separate the concerns of a large codebase to make it more manageable.

Chapter 7, Creating Menus with Menu and Tkinter Dialogs, outlines the creation of a main menu using Tkinter. It will also show the use of several built-in dialog types to implement common menu functionality.

Chapter 8, Navigating Records with Treeview and Notebook, details the construction of a data record navigation system using the Ttk Treeview and Notebook, as well as the conversion of our application from append-only to full read, write, and update capabilities.

Chapter 9, Improving the Look with Styles and Themes, informs you of how to change the colors, fonts, and widget styles of your application, and how to use them to make your application more usable and attractive.

Chapter 10, Maintaining Cross-Platform Compatibility, goes over Python and Tkinter techniques to keep your application running smoothly across Windows, macOS, and Linux systems.

Chapter 11, Creating Automated Tests with unittest, discusses how to verify your code with automated unit tests and integration tests.

Chapter 12, Improving Data Storage with SQL, takes you through the conversion of our application from CSV flat-file storage to SQL database storage. You'll learn all about SQL and relational data models as well.

Chapter 13, Connecting to the Cloud, covers how to work with network resources such as HTTP servers, REST services, and SFTP servers. You'll learn to interact with these services to download and upload data and files.

Chapter 14, Asynchronous Programming with Thread and Queue, explains how to use asynchronous and multithreaded programming to keep our application responsive during long-running processes.

Chapter 15, Visualizing Data Using the Canvas Widget, teaches you how to work with the Tkinter Canvas widget to create visualizations and animations. You'll also learn how to integrate Matplotlib charts and build a simple game.

Chapter 16, Packaging with setuptools and cxFreeze, explores preparing your Python application for distribution as a Python package or a standalone executable.