Created
June 22, 2016 06:43
-
-
Save Hironsan/3e47420055c70c29f804d4bd44490eba to your computer and use it in GitHub Desktop.
flask like decorator example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def route(rule, **options): | |
def decorator(f): | |
print(options) | |
print('do something') | |
return f | |
return decorator | |
@route('/index', method='POST') | |
def index(): | |
print("index page") | |
index() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment