import threading import time codedone = False def TestThreadOne(): input("Press Enter to Quit?\n") codedone = True def TestThreadTwo(): testcounter = 0 while not codedone: time.sleep(1) testcounter += 1 print(testcounter) if testcounter >= 30 break t1 = threading.Thread(target=TestThreadOne, daemon=False) t2 = threading.Thread(target=TestThreadTwo, daemon=True) t1.start() t2.start() # t1.join() # t2.join() print("Done!")