Output
The Output
Element is a re-direction of Stdout so that you can output to your window using a normal Python print
statement.
layout = [[sg.Output(size=(30, 10)), sg.Button('Hi!', k='-BUTTON1-')]]
# Window
window = sg.Window(title='Output Element', layout=layout)
# Event loop
while True:
event, values = window.read()
if event == sg.WIN_CLOSED:
break
# Prints get redirected to the Output Element
print(event)
Events
No events are generated
Values Dictionary
There will be no entry in the values dictionary
Implemented with Multiline
In early releases of PySimpleGUI, the Output
element was different from the Multliline
element. Over time, as more features were added to the Multline
element and because both of these elements show scrolling text, it made sense to use the Multiline
element to implement the Output
element.