How to Force exiting from program/script

Alex magobin at gmail.com
Wed Jul 15 17:26:53 EDT 2009


hi at all,
 I have made a script with a while loop and I want that after 30
seconds the program stop and exit . But the code like this doesn't
run:
In the Console I can see work so that function is correctly called...

#Function to exit
def exit():
    print "work"
    raise SystemExit()
t = threading.Timer(30.0, exit)
t.start()

# Loop
while True:
...many lines....




More information about the Python-list mailing list