65dbe540-906e-4bd4-bbb3-d24908780ba9
prompter
How do I run background threads in a PyQt5 GUI in Python?
d8d14367-d53f-4cfa-a43c-6eb5579dec7a
65dbe540-906e-4bd4-bbb3-d24908780ba9
assistant
#this is a background task that displays 'Ten seconds passed' in the PyQt5 main window every ten seconds
#this should be adapted for your perposes
def countTenSeconds():
    #Load PyQt5 GUI
    window = uic.loadUi("mainwindow.ui")
    #Do something
    window.print("Ten seconds passed ")
    #restart task
    threading.Timer(10, countTenSeconds).start()

#Start background task
threading.Timer(10, countTenSeconds).start()
85f65a3e-e582-45af-b3e5-0741f9b51474
d8d14367-d53f-4cfa-a43c-6eb5579dec7a
prompter
It actually worked, could you provide an alternative such as PySimpleGUI.

Please.