标签:home func 太上老君 out python comment int 练习 inner
qq = {'太上老君': '123456'}
wx = {'元始天尊': '123456'}
def zsqout(way):
if way.upper() == 'QQ':
def zsq(func):
def inner():
time = 3
while time > 0:
username = input('请输入账号:')
psw = input('请输入密码:')
if qq.get(username) == psw:
return func()
else:
time -= 1
return False
return inner
return zsq
elif way.upper() == 'WX':
def zsqwx(func):
def inner():
time = 3
while time > 0:
username = input('请输入账号:')
psw = input('请输入密码:')
if wx.get(username) == psw:
return func()
else:
time -= 1
return False
return inner
return zsqwx
@zsqout('qq')
def diary():
print('欢迎访问diary~~~~')
@zsqout('wx')
def comment():
print('欢迎访问comment~~~~')
@zsqout('qq')
def home():
print('欢迎访问home~~~~')
diary()
comment()
home()
标签:home func 太上老君 out python comment int 练习 inner
原文地址:https://www.cnblogs.com/zyyhxbs/p/11077612.html