1 Hello GUI

 

This chapter covers

  • Understanding what Python is
  • Knowing what a GUI is
  • Installing the required software
  • Building your first GUI

Welcome to Twisted Python Projects. Each chapter presents a new and exciting software project that is fun in its own right and teaches you programming skills in a programming language called Python, using a set of software tools called guizero. Python is a popular and versatile coding language, and guizero is an easy way to create interactive graphical interfaces (GUIs).

You can find GUIs everywhere; for example, the menus and buttons that enable you to interact with your smartphone or tablet are part of your phone’s GUI. The apps and games that you can download and play and the operating system on your computer all use GUIs. GUIs are everywhere because they’re the easiest way to communicate with a computer. The software we will use to create our GUIs is called guizero. I’ll tell you more about guizero later.

Each chapter covers building a new GUI with different features. When you’re done with this book, you can combine your new programming skills and techniques from each chapter to create your own or new versions or the GUIs.

Just what is Python?

What is a GUI and what is guizero?

Guizero elements and widgets

Writing a program with Python and guizero

Hello GUI: Coding your first GUI

Importing the modules

Creating the variables

Creating a function to display the pop-up message

Creating the GUI window and outputting the message

Running and testing your first GUI program

Three other things to try

Changing the background color

Resizing the text box

Using a warn window instead of the info window

Conclusions

Statements of fact