python 装饰器

 
  
 
   
装饰器:https://www.zhihu.com/question/26930016
装饰器:https://www.zhihu.com/question/26930016 有位知友讲解的很详细很清楚。
有位知友讲解的很清楚,容易理解。
from t
@gen.coroutine
def outer_coroutine():
before = time.time()
coroutines = [get_url(url) for url in [ 'URL1', 'URL2', 'URL3']]
result = yield coroutines
after = time.time()
print(result)
print( 'total time: {} seconds'.format(after - before))
if __name__ == '__main__':
IOLoop.current().run_sync(outer_coroutine)

你可能感兴趣的:(python)