I have a GUI app with a while loop. I'm having trouble inserting an if statement that breaks the loop. I want this to be a timer so if nothing happens in 60 seconds the while loop will break.
layout = [[sg.Text('Velg mappe som skal tas backup av og hvor du vil plassere backupen')],
[sg.Text('Source folder', size=(15, 1)), sg.InputText(a), sg.FolderBrowse()],
[sg.Text('Backup destination ', size=(15, 1)), sg.InputText(b), sg.FolderBrowse()],
[sg.Text('Made by XXX™')],
[sg.Submit("Kjør"), sg.Cancel("Exit")]]
window = sg.Window('Backup Runner v2.1')
while True: # Event Loop
event, values = window.Layout(layout).Read()
if event in (None, 'Exit'):
sys.exit("aa! errors!")
print("Skriptet ble stoppet")
if event == 'Kjør':
window.Close()
break