I have txt file with a list of words, and i want to read:
- Each word (from the txt file) with delay of 10 sec, and to "Do something". Then read the second word and "Do something" etc.
- Four words (at the same time) with the same delay.
I am using Python27.
My code is:
# Read text file
with open('D:\My_Path.txt', 'r') as fp:
lines = [line.rstrip('\n') for line in fp.readlines()]
time.sleep(10) # does not work well
for line in lines:
print (line)
def AB ():
'''Do something'''
AB ()