Hi
Im looking for a time delay code so my script runs to certain line waits for the time specified then continues.Ive found some but they seem to long and complicated. any ideas or links, books ect...

Many Thanks

HlA91

STAY COOL AND DONT GET STRESSED!:cool:

Recommended Answers

All 2 Replies

Function sleep(seconds) from module time is pretty much the best. Remember seconds is a float so you can delay 0.5 seconds.

import time

print "Hello ..."
time.sleep(2.5)  # wait 2.5 seconds
print "... there!"
Member Avatar

sorry, posted late. ;)

If you import the time module, you can use the sleep function.

time.sleep(seconds)

ex: time.sleep(5) waits five seconds

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.