\'\'\'
Authon:WSE_Gordon
This application is use for the costomer to login the application.
The Costomer need to input his or her username and password.
But it has a bed part. It is all the password is the same, I need to fix it late.
\'\'\'
seq_usernames=[]
seq_passwords=[]
with open(\"user_table.txt\",\'r\') as f:
first_username = f.readline()[9:]
print(first_username)
seq_usernames.append(first_username)
first_password = f.readline()[9:]
print(first_password)
seq_passwords.append(first_password)
second_username = f.readline()[9:]
print(second_username)
seq_usernames.append(second_username)
second_password = f.readline()[9:]
print(second_password)
seq_passwords.append(second_password)
f.close()
print(seq_usernames)
print(seq_passwords)
seq_user = dict.fromkeys(seq_usernames,\'123456\')
print(seq_user)
#用户输入
i = 0
for i in range(3):
username = input(\"请输入用户名username=\")
username = username + \'\\n\'
password = input(\"请输入密码password=\")
if username in seq_user and password == seq_user.get(username):
print(seq_user.get(username))
print(\"Congrantulation! You\'re right!\")
break
else:
print(\"Your are wrong,You need test again!\")
i = i + 1
else:
print(\"Sorry,You don\'t have time anymore\")
继续阅读与本文标签相同的文章
上一篇 :
阿里云服务器安装mysql数据库并建立远程链接
下一篇 :
从分布式一致性到共识机制(一)Paxos算法
-
不写代码也能玩转AI,uber最新开源项目了解一下?
2026-05-19栏目: 教程
-
MySQL从5.6到8.0并行复制的演进
2026-05-19栏目: 教程
-
RPA市场迅速升温的背后
2026-05-19栏目: 教程
-
Node中Buffer的初始化及回收
2026-05-19栏目: 教程
-
还在关注“宏颜获水”?DuerOS 5.0让你更惊讶
2026-05-19栏目: 教程
