Advertisement
Guest User

Untitled

a guest
Aug 4th, 2015
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. def get_password():
  2. new_content = []
  3. with open('passwords', encoding='utf-8') as file:
  4. content = file.readlines()
  5. for el in content:
  6. new_el = el.replace('\n', '')
  7. new_content.append(new_el)
  8. return new_content[0]
  9.  
  10.  
  11. def renew_passwords():
  12. new_content = []
  13. with open('passwords', encoding='utf-8') as file:
  14. content = file.readlines()
  15. for el in content:
  16. new_el = el.replace('\n', '')
  17. new_content.append(new_el)
  18. last = new_content[0]
  19. final = []
  20. final.append(new_content[1])
  21. final.append(new_content[2])
  22. final.append(new_content[3])
  23. final.append(new_content[4])
  24. final.append(new_content[5])
  25. final.append(last)
  26. with open('passwords', 'w+') as file:
  27. for el in final:
  28. if el!= final[-1]:
  29. file.write(el+'\n')
  30. else:
  31. file.write(el)
  32.  
  33.  
  34. get_password()
  35. renew_passwords()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement