The "Official Python GUI Programming with PySimpleGUI" Course

Welcome to the course! Let's start having some GUI fun together.

Each interactive part of a lesson generally consists of 3 parts:

  1. Try This - a program you'll study and learn from. All you need to do it run it
  2. It's Your Turn - A small, focused exercise
  3. Putting It Together Assignment - A project for you to complete as homework

The Python IDE you see embedded in this webpage are called Trinkets. You can run your PySimpleGUI Python code in these Trinkets.

It's often difficult to see the details of your PySimpleGUI window in these Trinkets. To enlarge the Trinket, switch to "full-screen mode". To switch to full-screen, click on the top left corner of the Trinket where there are 3 horizontal lines, and then choose "Fullscreen".

You can also download the code and run it on your computer, using your own Python interpreter, IDE, and copy of PySimpleGUI. Downloading the Trinket will, at minimum, download 2 files, the main.py file and a copy of PySimpleGUI.py. If you've installed PySimpleGUI on your computer, you should be able to delete the downloaded PySimpleGUI.py file. To download the files, click on the top left corner of the Trinket where there are 3 horizontal lines, and then choose "Download".

You will learn more about IDEs in upcoming lessons.

Don't forget that all of the PySimpleGUI documentation including the Call Reference and Cookbook is located at http://www.PySimpleGUI.org. The Call Reference tab in particular will be of interest as you work on exercises because it shows every function and every parameter available along with a description of each.

Let's get some windows displayed!!


Try This

Let's get some windows on your screen!

The two techniques you've learned so far include: 1. popup window 2. A single-shot window


It's Your Turn

This is exciting! Your first PySimpleGUI program.... that you wrote....

Yes, it's your "Hello, World" moment.

Make 2 windows with one being a popup and another a "one-shot" window.

Using the comments, fill in the program to create the parts needed to:

Your layout should have 2 rows with these elements on each row:

  1. Text element
  2. Button element

Your program should display "Hello World" in a Text element and have an "Exit" button.

Here is your starting point:


Putting It Together Assignment - Pounds to Kilograms Converter

Use your newly learned GUI skills to make a converter of pounds to kilograms

Here's a reminder of the formula to do the conversion 1 kilogram = 2.2 pounds

Collect the number of pounds using a 1-shot window. Output the result using a popup.

Don't forget that you will need to convert the value returned from the input from a string to a float or int. Don't worry yet that you don't know very much about the values variable that contains the information collected. Use the previous examples as your guide.

Your Window will need Text, Input, and Button elements.

Use this skeleton code as a starting point