import threading
import sys
from time import time
def stop():
print "stop"
sys.exit()
t = threading.Timer(10, stop)
volts = 22
if volts > 20:
t.start()
print "Start"
After 10 seconds it prints Stop, which is fine, but it ignores the sys.exit(). I need to do a sys.exit when the timer expires.