Web Analytics Made Easy - Statcounter
Skip to content

Debug Print (Popup Windows 3 of 4)

import PySimpleGUI as sg

sg.Print('Hello, World!')

image

import PySimpleGUI as sg

sg.Print('Hello, World of GUIs!')
sg.Print('While I have your attention...', end='', colors='white on red')
sg.Print('\nsg.Print looks much like the Python ', end='')
sg.Print('print', colors='white on green', end='')
sg.Print(' statement.')
sg.Print('But it also includes FUN additions like colors', text_color='purple')
sg.Print('As well a "wait" parameter to stop the program from exiting.', wait=True)

image

Like Python's print

This popup has many of the same parameters as Python's print statement. Rather than printing to the console, the output goes to the PySimpleGUI Debug Window.

As you can see, color printing is simple to do with this call, and you'll see other print-like calls later with similarly simple color options.

Unlike Python's print, it is less commonly used. Instead, a normal/plain popup are what most PySimpleGUI programmers use.

Try It For Yourself