I have a program that has an sg.Output
element, and I want a function to run after the window has opened/initialized.
This is a sample of my code:
import PySimpleGUI as sg
import os
layout = [[sg.Output(size=(50, 10))]]
window = sg.Window('SampleCode', layout)
def printAfter():
print('Hello')
while True:
event, values = window.read()
printAfter()
if event == sg.WIN_CLOSED:
break
Problem is it seems to print it before it could initialize the window.