Saad Javed wrote: > import time > > running = True > while running: > print 'yes' > time.sleep(10) > > This will print 'yes' after every 10s. I want to print 'yes' for 10s, then > quit.
Then combine the two techniques, the busy waiting loop with sleeping for a shorter amount of time: import time stop_time = time.time() + 10 while time.time() < stop_time: print "yes" time.sleep(.1) print "that's all folks" _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor