nephish said unto the world upon 21/06/2005 20:17:
> Hey all,
> how do i pause a script. like
> print 'something'
> pause a half second
> print 'something else'
>
> any takers?
>
> _______________________________________________
> Tutor maillist - [email protected]
> http://mail.python.org/mailman/listinfo/tutor
>
>
Hi,
import time
for i in range(5):
time.sleep(i)
print time.asctime()
when run produces:
>>> Tue Jun 21 18:23:00 2005
Tue Jun 21 18:23:01 2005
Tue Jun 21 18:23:03 2005
Tue Jun 21 18:23:06 2005
Tue Jun 21 18:23:10 2005
6.11 time -- Time access and conversions
"sleep(secs)
Suspend execution for the given number of seconds. The argument
may be a floating point number to indicate a more precise sleep time.
The actual suspension time may be less than that requested because any
caught signal will terminate the sleep() following execution of that
signal's catching routine. Also, the suspension time may be longer
than requested by an arbitrary amount because of the scheduling of
other activity in the system."
http://docs.python.org/lib/module-time.html
Best,
Brian vdB
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor