Created
September 14, 2018 13:52
-
-
Save zhangxiaoda007/b2a8246e6987620e0556a3f411f067e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
# author:The Machinist time:18-9-14 | |
count = 0 | |
_username = 'zhang' | |
_password = '123456' | |
f = open('blacklist.txt', 'r') | |
lock_name = f.read() | |
f.close() | |
F = open('word.txt', 'r') | |
lock_password = F.read() | |
F.close() | |
while count < 3: | |
username = input("username:") | |
password = input("password:") | |
if _username == username and _password == password: | |
print("欢迎登录") | |
break | |
elif lock_name == username and lock_password == password: | |
print("对不起,你的用户名及密码已锁定") | |
else: | |
print("登录失败") | |
count += 1 | |
if count == 3: | |
print("对不起,输入超过三次,用户名密码锁定") | |
f = open('blacklist.txt', 'a') | |
f.writelines(username) | |
f.close() | |
F = open('word.txt', 'a') | |
F.writelines(password) | |
F.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment