Web Analytics Made Easy - Statcounter
Skip to content

The Windowing APIs - Popups

The 1-line wonders of PySimpleGUI.

The Windowing APIs are, as the name implies, are based on the use of windows. The first group of these is the simplest as they are all 1-line function calls. These are the "popup" windows. All but 2 of them use the word "popup" in the name. Those 2 excepts are the "Debug Print" and the "One Line Progress Meter".

There are 4 types of popup calls.

1. An output popup window

sg.popup("Hello universe...I'm a 1-line GUI program!")

2. An input popup window

name = sg.popup_get_text('What is your name?')

3. Print to the Debug Window

sg.Print("Hello multiverse!?", colors='white on red')

4. One Line Progress Meter

for i in range(0, 100):
    sg.one_line_progress_meter("Just as the name says", i, 99)

There are numerous input and output popup functions.

Popup windows enable someone on their first day of programming to display useful windows. No blank 200 by 200 pixel windows to start you out. We're going into the deep end of the pool and learning something you can apply to your programming problem straight away.

These calls (they're all functions) can be split into 4 sets of calls

  1. Output Popups
  2. Input Popups
  3. Debug Print
  4. One-line Progress Meter