from flask import Flask
@app = Flask('/')
def hello():
return'hello word!'
#I will tell you how to understand the decorater @app = Flask('/') and it's working priciple:
#for axample of a decorater:
def my_decorater(f):
def wrapper():
print "starting : my name is xxx"
f()
print"ending : xxx is my name"
def hello ():
print "hello world"
hello()
#'''the output is "starting : my name is xxx
hello world
ending : xxx is my name" '''
@app = Flask('/')
def hello():
return'hello word!'
#I will tell you how to understand the decorater @app = Flask('/') and it's working priciple:
#for axample of a decorater:
def my_decorater(f):
def wrapper():
print "starting : my name is xxx"
f()
print"ending : xxx is my name"
return wrapper
def hello ():
print "hello world"
hello()
#'''the output is "starting : my name is xxx
hello world
ending : xxx is my name" '''