官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 丰顺县| 漠河县| 工布江达县| 镇沅| 甘孜县| 上栗县| 赣榆县| 石屏县| 双流县| 嘉峪关市| 辽源市| 蓝山县| 南和县| 依安县| 湖南省| 平乐县| 藁城市| 镇赉县| 民和| 定州市| 探索| 新巴尔虎左旗| 河东区| 房产| 中西区| 尖扎县| 富蕴县| 靖远县| 广河县| 四会市| 定南县| 郎溪县| 西乡县| 龙岩市| 峨边| 贺州市| 永泰县| 双江| 永善县| 图片| 确山县|