Guest User

Untitled

a guest
Dec 12th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. Craig  
  2. Rebekah  
  3. Zina  
  4. Stella  
  5. Zachary  
  6. Ila  
  7. Delsie  
  8. Mauro  
  9. Alba  
  10. Antoniette
  11. .... more
  12.  
  13. def script():
  14.  
  15. old_list = []
  16. old_names_list = [line.rstrip('n') for line in open('names.txt')]
  17.  
  18.  
  19. while True:
  20. new_names_list = [line.rstrip('n') for line in open('newnames.txt')]
  21.  
  22. #if new name added to the list, then we call a random function etc def hell():
  23. #and we continue to do the below.
  24.  
  25. for names in old_names_list:
  26.  
  27. if names not in old_list:
  28. print(names)
  29. #Call a random function etc def hello():
  30. old_list.append(names)
  31.  
  32. else:
  33. randomtime = random.randint(5, 15)
  34. print('No new names fouund! - retrying in {} secs'.format(randomtime))
  35. time.sleep(randomtime)
  36.  
  37. Rebekah  
  38. Zina  
  39. Stella  
  40.  
  41. Etc output:
  42.  
  43. Prints out all the names and continue the while True loop.
  44.  
  45. *Adding Craig to newnames.txt*
  46.  
  47. print("Found Craig in the old_list!")
  48.  
  49. continue to search if new names got added.
Add Comment
Please, Sign In to add comment