1 Hello GUI

 

This chapter covers

  • Understanding what Python is
  • Knowing what a GUI is
  • Building your first GUI

Welcome to Twelve Twisted Python Projects for Young Coders, mostly outrageous projects and a few sensible ones. This book walks you through, step by step, building exciting projects such as the F.A.R.T soundbox, a personal timer, a BAE or Bust calculator, even a Pixel Painter.

Each chapter presents a new project that teaches you how to create interactive Apps, which are actually, interactive, graphical user interfaces, known as GUIs for short.

You can find GUIs everywhere, for example, the menus and buttons that enable you to interact with your smartphone or tablet, your desktop computer, the GPS satnav and much more. This first chapter is a comfortable introduction to creating your first GUI using the Python programming language and guizero, an easy way to build GUIs with Python code. You will be walked through every step of building a simple project, from creating a file, writing the program code, testing your code, and then making improvements. When you’re finished with each project, you can combine your new programming skills and techniques to create your own or new versions.

Just what is Python?

What is a GUI and what is guizero?

Writing programs with Python and guizero

Hello GUI: Coding your first GUI

Importing the modules

Introducing 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

Summary