Silhouette freeze in multi-thread

I am adding a menu on Silhouette Startup. But it freezes on opening, because of the use of while loop in one of the options. I am threading for this loop, for the loop is still called in main thread, where Silhouette is running. Below is a code snippet example of function countdown called using thread while opening Silhouette:

import time
def countdown(n):
    while n > 0:
        print('T-minus', n)
        n -= 1
        time.sleep(5)
# Create and launch a thread
from threading import Thread
t = Thread(target = countdown, args =(10, ))
t.start()

The opening of Silhouette freezes along with Menu load, while waiting for the loop to end, even when I am using threading. Is there some other way to separate the Silhouette main thread with worker thread.

We haven’t tested Silhouette with Python threads.
But you can use Qt threads via the PySide2 API.

Have you had any success with threading in Silhouette since this post? I find a widget I created when launched standalone, functions perfectly fine with a PySide2 QThread, but within silhouette the widget begins failing the moment I attempt to start a Qthread.

Are you creating the widget from inside the thread? If so, Qt doesn’t support that - widgets should be created/updated from the main thread.

My main widget is created and updated in the main thread. I emit a signal from the Qthread Worker wtih the data I need. The threading works when run outside of silhouette.

I would need to know a lot more about what the widget is doing. Can you PM me your script?