摘要: >>> def printMax(a,b): if a>b: print(a,'is the max') else: print(b,'is hte max') >>> def addOne(a): print(a) a+=1 print(a) >>> a=3>>> addOne(a)34>>> d 阅读全文
posted @ 2017-05-25 15:22 JustLittle 阅读(328) 评论(0) 推荐(0)
摘要: 1 >>> def check_permission(func): 2 def wrapper(*args,**kwargs): 3 if kwargs.get('username')!='admin': 4 raise Exception('Sorry.You are not allowed.') 5 return func(*args,**kwargs) 6 return wra... 阅读全文
posted @ 2017-05-25 09:29 JustLittle 阅读(317) 评论(0) 推荐(0)