**
登录
**
from faker import Faker
fake = Faker(locale=‘zh_CN’) # 伪造中文数据
print(fake.ssn())
class Person:
def init(self, zhang_hao, sec_key):
self.z_h = zhang_hao
self.sk = sec_key
person_list = []
for i in range(0, 1000):
zhanghao = fake.name()
print(zhanghao)
seckey = fake.password()
print(seckey)
person = Person(zhanghao, seckey)
person_list.append(person)
print("----------------------注册--------------------")
while True:
z_h = input(“请输入账号,以回车结束:”)
sk = input(“请输入密码,以回车结束:”)
if len(sk) < 8 or len(sk) > 16:
print(“密码长度应限制在8-16位”)
else:
person_list.append(Person(z_h, sk))
break
print("----------------------登录--------------------")
while True:
z_h = input(“请输入账号,以回车结束:”)
sk = input(“请输入密码,以回车结束:”)
for i in person_list:
if z_h == i.z_h and sk == i.sk:
print(“登录成功”)
break
print(“欢迎进入系统“)