def login(func):
def testlogin():
for i in range(3):
_username="abc"
_passwrod="123456"
user_status = False
iuput = input("请输入账号:")
input1 = input("请输入密码:")
if iuput == _username and input1 == _passwrod:
user_status = True
func()
break
else:
print("输入的账号或密码不正确请重新输入")
print("------------------------")
continue
if user_status == False:
print("超出输入限制,自动退出")
return testlogin
@login
def moving():
print("vip窗口---------------")
def putong():
print("游客窗口----------------")
@login
def test():
print("普通用户------------------")
def test123():
zidian = {1:"vip窗口",2:"游客窗口",3:"普通用户"}
print(zidian)
for i in range(10):
input2 = int(input("请输入您选择的ID:::"))
if input2 in zidian.keys():
print(zidian[input2])
if zidian[input2] == "vip窗口":
moving()
break
if zidian[input2] == "普通用户":
test()
break
if zidian[input2] == "游客窗口":
putong()
break
print("输入有误,请重新输入")
continue
test123()
python 装饰器(语法糖)
Posted 蜗牛·哥
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python 装饰器(语法糖)相关的知识,希望对你有一定的参考价值。
以上是关于python 装饰器(语法糖)的主要内容,如果未能解决你的问题,请参考以下文章