Create Graphical User Interfaces with Python.pdf

(11543 KB) Pobierz
Laura Sach
Martin O’Hanlon
Create Graphical User
Interfaces with Python
How to build windows, buttons, and widgets
for your Python projects
2
CREATE GRAPHICAL USER INTERFACES
WITH PYTHON
CREATE GRAPHICAL USER INTERFACES
WITH PYTHON
First published in 2020 by Raspberry Pi Trading Ltd, Maurice Wilkes Building,
St. John's Innovation Park, Cowley Road, Cambridge, CB4 0DS
Publishing Director: Russell Barnes • Editor: Phil King
Design: Critical Media
CEO: Eben Upton
ISBN: 978-1-912047-91-8
The publisher and contributors accept no responsibility in respect of any omissions
or errors relating to goods, products or services referred to or advertised in this book.
Except where otherwise noted, the content of this book is licensed under a Creative
Commons Attribution-NonCommercial-ShareAlike 3.0 Unported
(CC BY-NC-SA 3.0)
3
About the authors...
Martin O'Hanlon
Martin works in the learning team at the Raspberry
Pi Foundation, where he creates online courses,
projects, and learning resources. He contributes
to the development of many open-source projects
and Python libraries, including guizero. As a child,
he wanted to be a computer scientist, astronaut,
or snowboard instructor.
Laura Sach
Laura leads the A Level team at the Raspberry
Pi Foundation, creating resources for students
to learn about Computer Science. She somehow
also manages to make cakes, hug cats, and
wrangle a toddler.
4
CREATE GRAPHICAL USER INTERFACES
WITH PYTHON
CREATE GRAPHICAL USER INTERFACES
WITH PYTHON
Welcome!
T
his book will show you how to use Python to create some fun graphical user
interfaces (GUIs) using the guizero library.
The guizero library started with the belief
that there must be an easier way for students in school to create Python GUIs. The
library itself was born one day on a long train journey from Cambridge, as the side project of a
secondary school teacher.
Guizero has grown significantly in terms of features, yet remained true to its original aim of
being simple but flexible. It is a library for all beginners to create with, for teachers to scaffold
learning with and for experts to save time with.
We hope that these projects and guizero brings you that little spark of excitement to
your Python programs. That spark might be anything from a button that does something
when you click it, to colours in your otherwise black and white Python programming, to a
full multicoloured Waffle.
It turns out that with open-source software, even if you don't know how to get the whole way
there, if you start, someone will help you. We are grateful to the many contributors who have
put time and effort into creating guizero, and to the thousands of people who have used it in
their projects. Enjoy your journey and be proud of your creations.
Laura and Martin
5
Zgłoś jeśli naruszono regulamin