Book description
Master over 80 object-oriented recipes to create amazing GUIs in Python and revolutionize your applications today
About This Book
Use object-oriented programming to develop amazing GUIs in Python
Create a working GUI project as a central resource for developing your Python GUIs
Easy-to-follow recipes to help you develop code using the latest released version of Python
Who This Book Is For
This book is for intermediate Python programmers who wish to enhance their Python skills by writing powerful GUIs in Python. As Python is such a great and easy to learn language, this book is also ideal for any developer with experience of other languages and enthusiasm to expand their horizon.
What You Will Learn
Create the GUI Form and add widgets
Arrange the widgets using layout managers
Use object-oriented programming to create GUIs
Create Matplotlib charts
Use threads and talking to networks
Talk to a MySQL database via the GUI
Perform unit-testing and internationalizing the GUI
Extend the GUI with third-party graphical libraries
Get to know the best practices to create GUIs
In Detail
Python is a multi-domain, interpreted programming language. It is a widely used general-purpose, high-level programming language. It is often used as a scripting language because of its forgiving syntax and compatibility with a wide variety of different eco-systems. Python GUI Programming Cookbook follows a task-based approach to help you create beautiful and very effective GUIs with the least amount of code necessary.
This book will guide you through the very basics of creating a fully functional GUI in Python with only a few lines of code. Each and every recipe adds more widgets to the GUIs we are creating. While the cookbook recipes all stand on their own, there is a common theme running through all of them. As our GUIs keep expanding, using more and more widgets, we start to talk to networks, databases, and graphical libraries that greatly enhance our GUI’s functionality. This book is what you need to expand your knowledge on the subject of GUIs, and make sure you’re not missing out in the long run.
Style and approach
This programming cookbook consists of standalone recipes, and this approach makes it unique.. While each recipe explains a certain concept, throughout the book you’ll build a more and more advanced GUI, recipe after recipe. In some of the advanced topics, we simply create a new GUI in order to explore these topics in depth.
Table of contents
- Credits
- Preface
-
Creating the GUI Form and Adding Widgets
- Introduction
- Creating our first Python GUI
- Preventing the GUI from being resized
- Adding a label to the GUI form
- Creating buttons and changing their text property
- Text box widgets
- Setting the focus to a widget and disabling widgets
- Combo box widgets
- Creating a check button with different initial states
- Using radio button widgets
- Using scrolled text widgets
- Adding several widgets in a loop
- Layout Management
-
Look and Feel Customization
- Introduction
- Creating message boxes - information, warning, and error
- How to create independent message boxes
- How to create the title of a tkinter window form
- Changing the icon of the main root window
- Using a spin box control
- Relief, sunken and raised appearance of widgets
- Creating tooltips using Python
- Adding a progressbar to the GUI
- How to use the canvas widget
- Data and Classes
- Matplotlib Charts
- Threads and Networking
-
Storing Data in our MySQL Database via our GUI
- Introduction
- Installing and connecting to a MySQL server from Python
- Configuring the MySQL database connection
- Designing the Python GUI database
- Using the SQL INSERT command
- Using the SQL UPDATE command
- Using the SQL DELETE command
- Storing and retrieving data from our MySQL database
- Using the MySQL workbench
-
Internationalization and Testing
- Introduction
- Displaying widget text in different languages
- Changing the entire GUI language, all at once
- Localizing the GUI
- Preparing the GUI for internationalization
- How to design a GUI in an agile fashion
- Do we need to test the GUI code?
- Setting debug watches
- Configuring different debug output levels
- Creating self-testing code using Python's __main__ section
- Creating robust GUIs using unit tests
- How to write unit tests using the Eclipse PyDev IDE
-
Extending Our GUI with the wxPython Library
- Introduction
- Installing the wxPython library
- Creating our GUI in wxPython
- Quickly adding controls using wxPython
- Trying to embed a main wxPython app in a main tkinter app
- Trying to embed our tkinter GUI code into wxPython
- Using Python to control two different GUI frameworks
- Communicating between the two connected GUIs
- Creating Amazing 3D GUIs with PyOpenGL and PyGLet
- Best Practices
Product information
- Title: Python GUI Programming Cookbook - Second Edition
- Author(s):
- Release date: May 2017
- Publisher(s): Packt Publishing
- ISBN: 9781787129450
You might also like
book
Python GUI Programming Cookbook - Third Edition
Over 90 recipes to help you develop widgets, forms, layouts, charts, and much more using the …
book
Python GUI Programming Cookbook
Over 80 object-oriented recipes to help you create mind-blowing GUIs in Python About This Book Use …
book
Qt5 Python GUI Programming Cookbook
Over 60 recipes to help you design interactive, smart, and cross-platform GUI applications Key Features Get …
book
Python GUI Programming with Tkinter
Find out how to create visually stunning and feature-rich applications by empowering Python's built-in Tkinter GUI …