Why doesn't It start threads again? (Python)
When I try to make threads go again, the script prints the output but actually doesn't start them (the threads). I writed down below the code to let a clear understanding of the problem (marked with #): import threading import time block = False def numera(name): name = str(threading.current_thread()) global block i = 0 while True: if block is False: print(name + " " + str(i)) i += 1 time.sleep(0.1) if i > 100: block = True break else: break name = 1 def handle_session(): global name for num in range(3): print("STARTING THREAD") threading.Thread(target=numera, args=(str(name),)).start() name += 1 handle_session() while True: name = 1 time.sleep(1) print(threading.current_thread(), block) if block is True: print("RESTART THREADS") handle_session() #THERE'S THE PROBLEM HERE block = False Plz Help Me :)))