Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Craig
- Rebekah
- Zina
- Stella
- Zachary
- Ila
- Delsie
- Mauro
- Alba
- Antoniette
- .... more
- def script():
- old_list = []
- old_names_list = [line.rstrip('n') for line in open('names.txt')]
- while True:
- new_names_list = [line.rstrip('n') for line in open('newnames.txt')]
- #if new name added to the list, then we call a random function etc def hell():
- #and we continue to do the below.
- for names in old_names_list:
- if names not in old_list:
- print(names)
- #Call a random function etc def hello():
- old_list.append(names)
- else:
- randomtime = random.randint(5, 15)
- print('No new names fouund! - retrying in {} secs'.format(randomtime))
- time.sleep(randomtime)
- Rebekah
- Zina
- Stella
- Etc output:
- Prints out all the names and continue the while True loop.
- *Adding Craig to newnames.txt*
- print("Found Craig in the old_list!")
- continue to search if new names got added.
Add Comment
Please, Sign In to add comment