I've been spending some time in searching for the correct code but I got no luck.
I have below python script with background thread and a main prog.. I want to restart the script once the background thread encounters a condition. Hope you can help me with this. TIA
With this script, both background_stuff and "main" are running at the same time.
def background_stuff():
while True:
if condition == 'True':
### restart the script
t = Thread(target=background_stuff)
t.start()
### main
if __name__ == '__main__':
while True:
#do something