My first python application
程序员文章站
2022-07-02 17:27:45
''' 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. ......
'''
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")
上一篇: 我是如何将博客转成PDF的
下一篇: [luogu3939][数颜色]
推荐阅读
-
My_first_blog
-
Python Web application deploy using uWSGI in ubuntu
-
First Day Python介绍
-
流畅的python First-Class Functions
-
python书籍推荐:Head First Python(中文版)
-
笨办法学Python - 习题1: A Good First Program
-
My first python application
-
详细解读Python的web.py框架下的application.py模块
-
[Python]Test Driven Development in Flask application
-
A first hand look at building an Android application