Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Tkinter GUI Programming by Example

You're reading from   Tkinter GUI Programming by Example Learn to create modern GUIs using Tkinter by building real-world projects in Python

Arrow left icon
Product type Paperback
Published in Apr 2018
Publisher Packt
ISBN-13 9781788627481
Length 340 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
David Love David Love
Author Profile Icon David Love
David Love
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Meet Tkinter 2. Back to the Command Line – Basic Blackjack FREE CHAPTER 3. Jack is Back in Style – the Blackjack GUI 4. The Finishing Touches – Sound and Animation 5. Creating a Highly Customizable Python Editor 6. Color Me Impressed! – Adding Syntax Highlighting 7. Not Just for Restaurants – All About Menus 8. Talk Python to Me – a Chat Application 9. Connecting – Getting Our Chat Client Online 10. Making Friends – Finishing Our Chat Application 11. Wrapping Up – Packaging Our Applications to Share 12. Other Books You May Enjoy

What this book covers

Chapter 1, Meet Tkinter, introduces us to the Tkinter library itself. We will look at ensuring that it is installed, how to use its widget system, and how to display widgets inside a window. Once the basics are down, we will have a play with some of the easier widgets, including using a Label widget to display text and a Button widget to provide interactivity.

Chapter 2, Back to the Command Line – Basic Blackjack, has us return to our roots as Python programmers and create a command-line only version of blackjack. This will get us up to speed with the common situation where we a command-line application, which we want to convert to a nicer interface. We will also discuss Python's class system and how to structure an application for conversion to a graphical interface.

 Chapter 3, Jack is Back in Style – the Blackjack GUI, starts off the process of converting command-line blackjack to a graphical application. We will learn about the powerful Canvas widget and how we can use it to draw both shapes and images on the user's screen. This chapter will end with us having a working game of blackjack with a graphical interface.

Chapter 4, The Finishing Touches – Sound and Animation, teaches how to use the Canvas widget to create animations, which we will use to spruce up our game of blackjack. Of course, animations wouldn't be complete without accompanying sounds, so we will also have a look at how to play sound effects.

Chapter 5, Creating a Highly Customizable Python Editor, begins our second application, a text editor. We explore Tkinter's Text widget and its capabilities for handling events. We will also look at the themed widgets, which come with Tkinter in its ttk module, giving our applications a much more professional look.

Chapter 6, Color Me Impressed! – Adding Syntax Highlighting, covers how we can use Tkinter's tag system to affect different parts of certain widgets. We will be taking advantage of this system to add syntax highlighting for the Python language to our text editor. We will also explore the indexing system, which Tkinter uses to locate items inside some of its widgets.

Chapter 7, Not Just for Restaurants – All about Menus, teaches how we can add different types of menu to our applications—from the top menu bar that most applications have, to right-click context menus.

Chapter 8, Talk Python to Me – a Chat Application, begins our third and final application, an online instant messenger. We will learn how to plan the layout for a more complicated application, then piece together all of the different components needed for a chat program. We will also learn how to combine images and text by implementing smileys into the chat.

Chapter 9, Connecting – Getting our Chat Application Online, explains how we can use web technologies, including flask, requests, and sqlite3, to get desktop GUI applications communicating with the internet.

Chapter 10, Making Friends – Finishing our Chat Application, covers adding a friend's system and blocking system to improve socializing within our application. We will also learn how to manipulate images in Python using PIL by introducing user avatars. We will also learn why threads are great for computationally expensive or repeated tasks inside a GUI application.

Chapter 11, Wrapping Up – Packaging our Applications to Share, finishes off the book by briefly covering some widgets, which we did not get the opportunity to use in our three example application. Afterward, we will look at packaging a Python and Tkinter application up for distribution among users of the three biggest desktop operating systems, Windows, Linux, and macOS.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime