python学习

#! /usr/bin/env python
#-*-conding:utf-8-*-
#编写登录接口
#定义用户信息
username = input("Please input name :")
password = "123.com"
count = 0
#定义lock文件
lock =open('lock.txt','+r')
lockname = lock.readlines()
#循环
for locknamelines in lockname:
locknamelines = locknamelines.strip('\n')
if username == locknamelines:
print("Account Be Locked!!Please Change User!")
quit()
lock.close()
while count < 3:
userpassword = input("Please input userpassword:")
if userpassword == password:
print("Welcome Login...")
break #正确则停止循环
else:
print("Login falied,Please try" ,3 - count, "times!!!")
count +=1
posted @ 2016-11-17 20:24  ShinyBoy1  阅读(123)  评论(0编辑  收藏  举报