3 options
Python GUI Programming with Tkinter : develop responsive and powerful GUI applications with Tkinter / Alan D. Moore.
- Format:
- Book
- Author/Creator:
- Moore, Alan D., 1958- author.
- Language:
- English
- Subjects (All):
- Graphical user interfaces (Computer systems)--Programming.
- Graphical user interfaces (Computer systems).
- Python (Computer program language).
- Object-oriented programming (Computer science).
- Physical Description:
- 1 online resource (452 pages)
- Edition:
- First edition
- Other Title:
- Python graphical user interface programming with Tkinter
- Place of Publication:
- Birmingham, England : Packt Publishing, 2018.
- System Details:
- text file
- Summary:
- Find out how to create visually stunning and feature-rich applications by empowering Python's built-in Tkinter GUI toolkit About This Book Explore Tkinter's powerful features to easily design and customize your GUI application Learn the basics of 2D and 3D animation in GUI applications. Learn to integrate stunning Data Visualizations using Tkinter Canvas and Matplotlib. Who This Book Is For This book will appeal to developers and programmers who would like to build GUI-based applications. Knowledge of Python is a prerequisite. What You Will Learn Implement the tools provided by Tkinter to design beautiful GUIs Discover cross-platform development through minor customizations in your existing application Visualize graphs in real time as data comes in using Tkinter's animation capabilities Use PostgreSQL authentication to ensure data security for your application Write unit tests to avoid regressions when updating code In Detail Tkinter is a lightweight, portable, and easy-to-use graphical toolkit available in the Python Standard Library, widely used to build Python GUIs due to its simplicity and availability. This book teaches you to design and build graphical user interfaces that are functional, appealing, and user-friendly using the powerful combination of Python and Tkinter. After being introduced to Tkinter, you will be guided step-by-step through the application development process. Over the course of the book, your application will evolve from a simple data-entry form to a complex data management and visualization tool while maintaining a clean and robust design. In addition to building the GUI, you'll learn how to connect to external databases and network resources, test your code to avoid errors, and maximize performance using asynchronous programming. You'll make the most of Tkinter's cross-platform availability by learning how to maintain compatibility, mimic platform-native look and feel, and build executables for deployment across popular computing platforms. By the end of this book, you will have the skills and confidence to design and build powerful high-end GUI applications to solve real-world problems. Style and approach This is a comprehensive guide that explores the essential Tkinter features and modules and implements them in building real-world cross-platform GUI applications Downloading the example code for this book You can download the example code files for all Packt books you have purchased from your account at http://ww...
- Contents:
- Cover
- Title Page
- Copyright and Credits
- Dedication
- Packt Upsell
- Contributors
- Table of Contents
- Preface
- Chapter 1: Introduction to Tkinter
- Introducing Tkinter and Tk
- Choosing Tkinter
- Installing Tkinter
- Installing Python 3 on Windows
- Installing Python 3 on macOS
- Installing Python 3 and Tkinter on Linux
- Introducing IDLE
- Using the shell mode of IDLE
- Using the editor mode of IDLE
- IDLE as a Tkinter example
- Creating a Tkinter Hello World
- Creating a better Hello World Tkinter
- Summary
- Chapter 2: Designing GUI Applications with Tkinter
- A problem at ABQ AgriLabs
- Assessing the problem
- Gathering information about the problem
- What you found out
- Information about the data being collected
- Information about the users of the application
- Documenting specification requirements
- Contents of a simple specification
- Writing the ABQ data entry program specification
- Designing the application
- Exploring Tkinter input widgets
- Grouping our fields
- Laying out the form
- Laying out the application
- Chapter 3: Creating Basic Forms with Tkinter and ttk Widgets
- Evaluating our technology choices
- Choosing a technology
- Exploring Tkinter widgets
- The Entry widget
- The Spinbox widget
- The Combobox widget
- The Checkbutton widget
- The Text widget
- The Button widget
- The LabelFrame widget
- Implementing the application
- Saving some time with a LabelInput class
- Building the form
- Adding LabelFrame and other widgets
- Retrieving data from our form
- Resetting our form
- Building our application class
- Saving to CSV
- Finishing and testing
- Chapter 4: Reducing User Error with Validation and Automation
- Validating user input
- Strategies to prevent data errors
- Validation in Tkinter
- Creating a DateEntry widget.
- Implementing validated widgets in our form
- Exploiting the power of multiple inheritance
- A validating mixin class
- Building our widgets
- Requiring data
- A Date widget
- A better Combobox widget
- A range-limited Spinbox widget
- Dynamically adjusting the Spinbox range
- Updating our form
- Displaying errors
- Preventing form submission on error
- Automating input
- Inserting a date
- Automating Lab, Time, and Technician
- Chapter 5: Planning for the Expansion of Our Application
- Separating concerns
- The MVC pattern
- What is a model?
- What is a view?
- What is a controller?
- Why complicate our design?
- Structuring our application directory
- Basic directory structure
- The abq_data_entry.py file
- The README.rst file
- ReStructuredText
- Populating the docs folder
- Making a Python package
- Splitting our application into multiple files
- Creating the models module
- Moving the widgets
- Moving the views
- Removing redundancy in our view logic
- Creating the application file
- Running the application
- Using version control software
- A super-quick guide to using Git
- Initializing and configuring a Git repository
- Adding and committing code
- Viewing and using our commits
- Chapter 6: Creating Menus with Menu and Tkinter Dialogs
- Solving problems in our application
- Deciding how to address these problems
- Implementing simple Tkinter dialogs
- Tkinter messagebox
- Showing the error dialogs
- Designing our menu
- Creating menus in Tkinter
- Implementing our application menu
- Showing an About dialog
- Adding the menu functionality in the controller
- Handling file selection
- Making our settings work
- Persisting settings
- Building a model for settings persistence
- Using the settings model in our application
- Summary.
- Chapter 7: Navigating Records with Treeview
- Implementing read and update in the model
- Adding read and update to our model
- Implementing get_all_records()
- Implementing get_record()
- Adding update to save_record()
- Implementing a record list view
- The ttk Treeview
- Implementing our record list with Treeview
- Configuring a Treeview widget
- Adding a scrollbar
- Populating the Treeview
- Responding to record selection
- Modifying the record form for read and update
- Updating __init__()
- Adding a load_record() method
- Updating the rest of the application
- Main menu changes
- Connecting the pieces in Application
- Adding the RecordList view
- Moving the model
- Populating the record list
- Adding the new callbacks
- Cleaning up
- Testing our program
- Chapter 8: Improving the Look with Styles and Themes
- Working with images in Tkinter
- Tkinter PhotoImage
- Adding the company logo
- Setting our Window icon
- Styling Tkinter widgets
- Widget color properties
- Using widget properties on our form
- Using tags
- Styling our record list with tags
- Tkinter fonts
- Giving users font options
- Styling Ttk widgets
- Exploring a Ttk widget
- Styling our form labels
- Styling input widgets on error
- Making our Spinbox a Ttk widget
- Updating ValidatedMixin
- Setting themes
- Building a theme selector
- Chapter 9: Maintaining Cross-Platform Compatibility
- Writing cross-platform Python
- Filenames and filepaths across platforms
- Path separators and drives
- Path separator translation
- The os.path module
- The pathlib module
- Case-sensitivity
- Symbolic links
- Path variables
- Inconsistent library and feature support
- Python's platform-limited libraries
- Checking low-level function compatibility
- The dangers of the subprocess module.
- Text file encodings and formats
- Graphical and console modes
- Writing code that changes according to the platform
- Writing cross-platform Tkinter
- Tkinter version differences across platforms
- Application menus across platforms
- Menu widget capabilities
- Menu guidelines and standards
- Windows user experience interaction guidelines
- Apple's human interface guidelines
- Linux and BSD human interface guidelines
- Accelerator keys
- Fonts
- Theme support
- Window zoomed state
- Improving our application's cross-platform compatibility
- Storing preferences correctly
- Specifying an encoding for our CSV file
- Making platform-appropriate menus
- Preparing our MainMenu class
- Building the Windows menu
- Building the Linux menu
- Building the macOS menu
- Creating and using our selector function
- Chapter 10: Creating Automated Tests with unittest
- Automated testing basics
- A simple unit test
- The unittest module
- Writing a test case
- TestCase assertion methods
- Fixtures
- Using Mock and patch
- Running multiple unit tests
- Testing Tkinter code
- Managing asynchronous code
- Simulating user actions
- Specifying an event sequence
- Managing focus and grab
- Getting widget information
- Writing tests for our application
- Testing our model
- Testing file reading in get_all_records()
- Testing file saving in save_record()
- More tests
- Testing our application
- Testing our widgets
- Unit testing the ValidatedSpinbox widget
- Integration testing the ValidatedSpinbox widget
- Testing our mixin class
- Chapter 11: Improving Data Storage with SQL
- PostgreSQL
- Installing and configuring PostgreSQL
- Connecting with psycopg2
- SQL and relational database basics
- Basic SQL operations
- Syntax differences from Python
- Defining tables and inserting data.
- Retrieving data from tables
- Updating rows, deleting rows, and more WHERE clauses
- Subqueries
- Joining tables
- Learning more
- Modeling relational data
- Normalization
- The entity-relationship diagrams
- Assigning data types
- Creating the ABQ database
- Creating our tables
- Creating the lookup tables
- The lab_checks table
- The plot_checks table
- Creating a view
- Integrating SQL into our application
- Creating a new model
- Adjusting the Application class for the SQL backend
- Building a login window
- Using the login window
- Fixing some model incompatibilities
- DataRecordForm creation
- Fixing the open_record() method
- Fixing the on_save() method
- Creating new callbacks
- Updating our views for the SQL backend
- The data record form
- The record list
- Last changes
- Chapter 12: Connecting to the Cloud
- HTTP using urllib
- Basic downloading with urllib.request
- Creating a download function
- Parsing XML weather data
- Implementing weather data storage
- Creating the SQL table
- Implementing the SQLModel.add_weather_data() method
- Updating the SettingsModel class
- Adding the GUI elements for weather download
- HTTP using requests
- Installing and using requests
- The requests.session() fucntion
- The response objects
- Implementing API upload
- Creating a test HTTP service
- Creating our network function
- Updating application
- Updating the models.py file
- Finishing up
- FTP using ftplib
- Basic concepts of FTP
- Creating a test FTP service
- Implementing the FTP upload function
- Listing files
- Retrieving files
- Deleting or renaming files
- Adding FTP upload to the GUI
- Chapter 13: Asynchronous Programming with Thread and Queue
- Tkinter's event queue
- The after() and after_idle() methods
- The update() and update_idletasks () methods.
- Eliminating freezes with after() and update_idletasks ().
- Notes:
- Description based on print version record.
- Includes bibliographical references and index.
- OCLC:
- 1037816362
The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.