Guest User

Untitled

a guest
Sep 14th, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding:utf-8 -*-
  3. # author:The Machinist time:18-9-14
  4.  
  5. count = 0
  6. _username = 'zhang'
  7. _password = '123456'
  8.  
  9. f = open('blacklist.txt', 'r')
  10. lock_name = f.read()
  11. f.close()
  12.  
  13. F = open('word.txt', 'r')
  14. lock_password = F.read()
  15. F.close()
  16.  
  17.  
  18. while count < 3:
  19. username = input("username:")
  20. password = input("password:")
  21. if _username == username and _password == password:
  22. print("欢迎登录")
  23. break
  24. elif lock_name == username and lock_password == password:
  25. print("对不起,你的用户名及密码已锁定")
  26. else:
  27. print("登录失败")
  28. count += 1
  29.  
  30. if count == 3:
  31. print("对不起,输入超过三次,用户名密码锁定")
  32. f = open('blacklist.txt', 'a')
  33. f.writelines(username)
  34. f.close()
  35. F = open('word.txt', 'a')
  36. F.writelines(password)
  37. F.close()
Add Comment
Please, Sign In to add comment