Tell Python to wait/pause a 'for' loop

If you want to wait for a manual signal to continue, wait for the user to press Enter:

Python 2:

raw_input("Press Enter to continue...")

Python 3:

input("Press Enter to continue...")

If you can download the file in the python code, do that instead of doing the manual task for each of the files.


You can use time.sleep() to pause the execution for t seconds:

import time
time.sleep(1.3) # Seconds

Demo:

import time

print "Start Time: %s" % time.ctime()
time.sleep(5)
print "End Time: %s" % time.ctime()

Output

Start Time: Tue Feb 17 10:19:18 2009
End Time: Tue Feb 17 10:19:23 2009

Tags:

Python

Loops