Book description
Over 80 object-oriented recipes to help you create mind-blowing GUIs in Python
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
- Packed with easy-to-follow recipes to help you develop code using the latest released version of Python
Who This Book Is For
If you are a Python programmer with intermediate level knowledge of GUI programming and want to learn how to create beautiful, effective, and responsive GUIs using the freely available Python GUI frameworks, this book is for you.
What You Will Learn
- Create amazing GUIs with Python's built-in Tkinter module
- Customize the GUIs by using layout managers to arrange the GUI widgets
- Advance to an object-oriented programming style using Python
- Develop beautiful charts using the free Matplotlib Python module
- Use threading in a networked environment to make the GUIs responsive
- Discover ways to connect the GUIs to a database
- Understand how unit tests can be created and internationalize the GUI
- Extend the GUIs with free Python frameworks using best practices
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. Its flexible syntax enables developers to write short scripts while at the same time, they can use object-oriented concepts to develop very large projects.
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 uses the simplest programming style, using the fewest lines of code to create a GUI in Python, and then advances to using object-oriented programming in later chapters. If you are new to object-oriented programming (OOP), this book will teach you how to take advantage of the OOP coding style in the context of creating GUIs written in Python.
Throughout the book, you will develop an entire GUI application, building recipe upon recipe, connecting the GUI to a database. In the later chapters, you will explore additional Python GUI frameworks, using best practices. You will also learn how to use threading to ensure your GUI doesn't go unresponsive.
By the end of the book, you will be an expert in Python GUI programming to develop a common set of GUI applications.
Style and approach
Every recipe in this programming cookbook solves a problem you might encounter in your programming career. At the same time, most of the recipes build on each other to create an entire, real-life GUI application.
Table of contents
-
Python GUI Programming Cookbook
- Table of Contents
- Python GUI Programming Cookbook
- Credits
- About the Author
- About the Reviewers
- www.PacktPub.com
- Preface
-
1. 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
- 2. Layout Management
-
3. 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
- How to use the canvas widget
- 4. Data and Classes
- 5. Matplotlib Charts
- 6. Threads and Networking
- 7. Storing Data in Our MySQL Database via Our GUI
-
8. 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
-
9. Extending Our GUI with the wxPython Library
- Introduction
- How to install the wxPython library
- How to create 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
- How to use Python to control two different GUI frameworks
- How to communicate between the two connected GUIs
- 10. Creating Amazing 3D GUIs with PyOpenGL and PyGLet
- 11. Best Practices
- Index
Product information
- Title: Python GUI Programming Cookbook
- Author(s):
- Release date: December 2015
- Publisher(s): Packt Publishing
- ISBN: 9781785283758
You might also like
book
Python GUI Programming Cookbook - Second Edition
Master over 80 object-oriented recipes to create amazing GUIs in Python and revolutionize your applications today …
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 Cookbook - Third Edition
Over 90 recipes to help you develop widgets, forms, layouts, charts, and much more using the …
book
Python GUI Programming - A Complete Reference Guide
Explore Python's GUI frameworks and create visually stunning and feature-rich applications Key Features Integrate stunning data …