1 parent b7b81ee commit 027de25Copy full SHA for 027de25
1 file changed
test_decorator/test.py
@@ -0,0 +1,21 @@
1
+#!/usr/bin/env python
2
+# coding=utf-8
3
+def decorator1(func):
4
+ def wrapper():
5
+ print 'hello python 1'
6
+ func()
7
+ print 'end 1'
8
+ return wrapper
9
+
10
+def decorator2(func):
11
12
+ print 'hello python 2'
13
14
+ print 'end 2'
15
16
17
+@decorator1
18
+def test():
19
+ print 'hello python!'
20
21
+test()
0 commit comments