superpollo wrote:
hi folks.the follwing shoud print 'stuff' for 3 seconds and then stop. why it does not work? (prints stuff forever)1 #!/usr/bin/python 2 3 import threading 4 import sys 5 6 t = threading.Timer(3.0, sys.exit) 7 t.start() 8 while True: 9 print "stuff ",
The Timer runs the function in another thread. Perhaps sys.exit is just exiting that thread and not the main thread. -- http://mail.python.org/mailman/listinfo/python-list