I'm trying to program a kill sequence for a for loop, all the samples I see are for while loops, below is my code
I tried using the answer in here How to kill a while loop with a keystroke? using a while and my for inside the while, that allowed me to escape each for loop but it went on infinitely, and on its own as per the below fails too
results = []
try:
for i in sites:
do stuff for each site
except KeyboardInterrupt:
print 'Keyboard Interrupt: script cancelled'
import sys
sys.exit()
tried
try:
while True:
for i in sites: