PythonWrongNotes

Posted langjitianyadaolao

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PythonWrongNotes相关的知识,希望对你有一定的参考价值。

1.  

def auth(func):
def inDecoretor(*args,**kwargs):
username = input("username:")
password = input("password:")
func(args,kwargs) //TypeError: home() takes 0 positional arguments but 2 were given
return inDecoretor

def auth(func):
def inDecoretor(*args,**kwargs):
username = input("username:")
password = input("password:")
func(*args,*kwargs)
return inDecoretor

2.

def auth(): //TypeError: auth() takes 0 positional arguments but 1 was given
def outDecoretor(func):
def inDecoretor(*args, **kwargs):
username = input("username:")
password = input("password:")
func(*args, **kwargs)
return inDecoretor
return outDecoretor

@auth
def home():
print("this is home")



def auth(autoType):
def outDecoretor(func):
def inDecoretor(*args, **kwargs):
username = input("username:")
password = input("password:")
func(*args, **kwargs)
return inDecoretor
return outDecoretor

@auth("parameter")
def home():
print("this is home")
 

 

3.

4.

5.

6.

 




 










































以上是关于PythonWrongNotes的主要内容,如果未能解决你的问题,请参考以下文章

VSCode自定义代码片段——CSS选择器

谷歌浏览器调试jsp 引入代码片段,如何调试代码片段中的js

片段和活动之间的核心区别是啥?哪些代码可以写成片段?

VSCode自定义代码片段——.vue文件的模板

VSCode自定义代码片段6——CSS选择器

VSCode自定义代码片段——声明函数