# _*_coding:utf-8_*_
# Author:len liu
user_list={'len':'aaa','len1':'bbb','len2':'ccc'}
def auth(func):
def warrper(*args,**kwargs):
#while True:
username=input('pls enter your usename:').strip()
password=input('pls enter your passwd:').strip()
if username in user_list and password == user_list[username]:
print("success login")
res=func(*args,**kwargs)
return res
else:print('username or pasword error!')
return warrper
@auth
def index():
print("welcome to index page!")
@auth
def home(name):
print("welcome %s to home page!" %(name))
index()
home('len')