码迷,mamicode.com
首页 > 其他好文 > 详细

文件操作_用户登陆问题

时间:2018-09-01 16:25:06      阅读:120      评论:0      收藏:0      [点我收藏+]

标签:mat   pre   port   passwd   ati   info   用户   文件   login   

# username = input("please enter your name:")
# passport = input("please enter your passport:")

# with open("list of info",mode="w", encoding="utf-8" ) as f:
# f.write("{}\n{}".format(username,passport))

# print("congratulations")
lis = []
i = 0
while i < 3:
uname = input("please enter your username:")
passwd = input("please enter your password:")


with open("list of info", "r", encoding="utf-8") as f:
for line in f:
lis.append(line)
if uname == lis[0].strip() and passwd == lis[1].strip():
print("Login sucessfully")
break
else:
print("wrong")
i += 1

文件操作_用户登陆问题

标签:mat   pre   port   passwd   ati   info   用户   文件   login   

原文地址:https://www.cnblogs.com/jly1/p/9570678.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!