文章出處
文章列表
#! /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
文章列表
全站熱搜