更新时间:2021-08-27 18:49:38
封面
Title Page
Copyright and Credits
Tkinter GUI Programming by Example
Packt Upsell
Why subscribe?
PacktPub.com
Contributors
About the author
About the reviewer
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Get in touch
Reviews
Meet Tkinter
Installation
How will the code be structured?
Geometry managers
pack
grid
place
To pack or to grid?
Getting going
Adding interactivity
Using variables
Our first try
Creating Tkinter-compatible variables
Using and updating
Fixing our application
Showing messages
Showing information with showinfo
Showing warnings or errors
Getting feedback from the user
Getting text input
Summary
Back to the Command Line – Basic Blackjack
Python's class system
Instances
Inheritance
Blackjack's classes
The Card class
The Deck class
The Hand class
The Game class and main loop
Command line versus GUI
Interactivity
Familiarity
Ease of use
Size and portability
Jack is Back in Style – the Blackjack GUI
Moving from the command line to a graphical interface
The Canvas widget
Creating a graphical blackjack game
Card Deck and Hand
The GameState class
The GameScreen class
Playing our game
The Finishing Touches – Sound and Animation
Python's module system
The blackjack packages
The casino package
The casino_sounds package
Setting up a virtual environment
Creating the package
The blackjack.py file
Initializing the GameWindow class
Choosing to hit
Choosing to stick
Running out of money
Finishing off
Creating a Highly Customizable Python Editor
The ttk submodule
Styling a tk widget
Styling a ttk widget
Ttk style inheritance
Beginning our text editor
Tkinter's event system
Binding an event
Overwriting default events
Generating events
Events in our text editor
A second top-level window
Color Me Impressed! – Adding Syntax Highlighting
Tkinter's indexing system
Getting the cursor's position
Named indexes
Special strings
Line endings