def login(string):
def outer(func):
def inner(*args,**kwargs):
name = input('name:')
password = input('password:')
if name == 'a' and password == '123':
func(*args,**kwargs)
else:
print('失败!')
return inner
return outer
# @login('qq') # @的作用就是下面函数装入到login中, hi = login('qq')(hi) = inner
def hi(style):
print('==欢迎进入==',style)
# b = henen()
a = login('qq')
print(a)
hello = a(hi)
print(hello)
hello('go')
# a()
# henen('3p') # inner()