Python GUI Programming Cookbook
eBook - ePub

Python GUI Programming Cookbook

Burkhard A. Meier

Partager le livre
  1. 350 pages
  2. English
  3. ePUB (adapté aux mobiles)
  4. Disponible sur iOS et Android
eBook - ePub

Python GUI Programming Cookbook

Burkhard A. Meier

DĂ©tails du livre
Aperçu du livre
Table des matiĂšres
Citations

À propos de ce livre

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.

Foire aux questions

Comment puis-je résilier mon abonnement ?
Il vous suffit de vous rendre dans la section compte dans paramĂštres et de cliquer sur « RĂ©silier l’abonnement ». C’est aussi simple que cela ! Une fois que vous aurez rĂ©siliĂ© votre abonnement, il restera actif pour le reste de la pĂ©riode pour laquelle vous avez payĂ©. DĂ©couvrez-en plus ici.
Puis-je / comment puis-je télécharger des livres ?
Pour le moment, tous nos livres en format ePub adaptĂ©s aux mobiles peuvent ĂȘtre tĂ©lĂ©chargĂ©s via l’application. La plupart de nos PDF sont Ă©galement disponibles en tĂ©lĂ©chargement et les autres seront tĂ©lĂ©chargeables trĂšs prochainement. DĂ©couvrez-en plus ici.
Quelle est la différence entre les formules tarifaires ?
Les deux abonnements vous donnent un accĂšs complet Ă  la bibliothĂšque et Ă  toutes les fonctionnalitĂ©s de Perlego. Les seules diffĂ©rences sont les tarifs ainsi que la pĂ©riode d’abonnement : avec l’abonnement annuel, vous Ă©conomiserez environ 30 % par rapport Ă  12 mois d’abonnement mensuel.
Qu’est-ce que Perlego ?
Nous sommes un service d’abonnement Ă  des ouvrages universitaires en ligne, oĂč vous pouvez accĂ©der Ă  toute une bibliothĂšque pour un prix infĂ©rieur Ă  celui d’un seul livre par mois. Avec plus d’un million de livres sur plus de 1 000 sujets, nous avons ce qu’il vous faut ! DĂ©couvrez-en plus ici.
Prenez-vous en charge la synthÚse vocale ?
Recherchez le symbole Écouter sur votre prochain livre pour voir si vous pouvez l’écouter. L’outil Écouter lit le texte Ă  haute voix pour vous, en surlignant le passage qui est en cours de lecture. Vous pouvez le mettre sur pause, l’accĂ©lĂ©rer ou le ralentir. DĂ©couvrez-en plus ici.
Est-ce que Python GUI Programming Cookbook est un PDF/ePUB en ligne ?
Oui, vous pouvez accĂ©der Ă  Python GUI Programming Cookbook par Burkhard A. Meier en format PDF et/ou ePUB ainsi qu’à d’autres livres populaires dans Computer Science et Programming in Python. Nous disposons de plus d’un million d’ouvrages Ă  dĂ©couvrir dans notre catalogue.

Informations

Année
2015
ISBN
9781785283758

Python GUI Programming Cookbook


Table of Contents

Python GUI Programming Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Creating the GUI Form and Adding Widgets
Introduction
Creating our first Python GUI
Getting ready
How to do it...
How it works...
There's more...
Preventing the GUI from being resized
Getting ready
How to do it...
How it works...
Adding a label to the GUI form
Getting ready
How to do it...
How it works...
There's more...
Creating buttons and changing their text property
Getting ready
How to do it...
How it works...
There's more...
Text box widgets
Getting ready
How to do it...
How it works...
Setting the focus to a widget and disabling widgets
Getting ready
How to do it...
How it works...
There's more...
Combo box widgets
Getting ready
How to do it...
How it works...
There's more...
Creating a check button with different initial states
Getting ready
How to do it...
How it works...
Using radio button widgets
Getting ready
How to do it...
How it works...
There's more...
Using scrolled text widgets
Getting ready
How to do it...
How it works...
Adding several widgets in a loop
Getting ready
How to do it...
How it works...
There's more...
2. Layout Management
Introduction
Arranging several labels within a label frame widget
Getting ready
How to do it...
How it works...
There's more...
Using padding to add space around widgets
Getting ready
How to do it...
How it works...
How widgets dynamically expand the GUI
Getting ready
How to do it...
How it works...
There's more...
Aligning the GUI widgets by embedding frames within frames
Getting ready
How to do it...
How it works...
Creating menu bars
Getting ready
How to do it...
How it works...
There's more

Creating tabbed widgets
Getting ready
How to do it...
How it works...
Using the grid layout manager
Getting ready

How to do it...
How it works...
3. Look and Feel Customization
Introduction
Creating message boxes – information, warning, and error
Getting ready
How to do it...
How it works...
How to create independent message boxes
Getting ready
How to do it...
How it works...
How to create the title of a tkinter window form
Getting ready
How to do it...
How it works...
Changing the icon of the main root window
Getting ready
How to do it...
How it works...
Using a spin box control
Getting ready
How to do it...
How it works...
Relief, sunken, and raised appearance of widgets
Getting ready
How to do it...
How it works...
Creating tooltips using Python
Getting ready
How to do it...
How it works...
How to use the canvas widget
Getting ready
How to do it...
How it works...
4. Data and Classes
Introduction
How to use StringVar()
Getting ready
How to do it...
How it works...
How to get data from a widget
Getting ready
How to do it...
How it works...
Using module-level global variables
Getting ready
How to do it...
How it works...
How coding in classes can improve the GUI
Getting ready
How to do it...
How it works...
Writing callback functions
Getting ready
How to do it...
How it works...
Creating reusable GUI components
Getting ready
How to do it...
How it works...
5. Matplotlib Charts
Introduction
Creating beautiful charts using Matplotlib
Getting ready
How to do it...
How it works...
Matplotlib – downloading modules using pip
Getting ready
How to do it...
How it works...
Matplotlib – downloading modules with whl extensions
Getting ready
How to do it...
How it works...
Creating our first chart
Getting ready
How to do it...
How it works...
Placing labels on charts
Getting ready
How to do it...
How it works...
How to give the chart a legend
Getting ready
How to do it...
How it works...
Scaling charts
Getting ready
How to do it...
How it works...
Adjusting the scale of charts dynamically
Getting ready
How to do it...
How it works...
6. Threads and Networking
Introduction
How to create multiple threads
Getting ready
How to do it...
How it works...
Starting a thread
Getting ready
How to do it...
How it works...
Stopping a thread
Getting ready
How to do it...
How it works...
How to use queues
Getting ready
How to do it...
How it works...
Passing queues among different modules
Getting ready
How to do it...
How it works...
Using dialog widgets to copy files to your network
Getting ready
How to do it...
How it works...
Using TCP/IP to communicate via networks
Getting ready
How to do it...
How it works...
Using URLOpen to read data from websites
Getting ready
How to do it...
How it works...
7. Storing Data in Our MySQL Database via Our GUI
Introduction
Connecting to a MySQL database from Python
Getting ready
How to do it

How it works

Configuring the MySQL connection
Getting ready
How to do it

How it works

Designing the Python GUI database
Getting ready
How to do it

How it works
...

Table des matiĂšres