【文件属性】:
文件名称:tornado协程示例
文件大小:8KB
文件格式:MD
更新时间:2021-11-29 02:44:56
python tornado
tornado协程的理解示例
编写协程函数
from tornado import gen
from tornado.httpclient import AsyncHTTPClient
@gen.coroutine
def coroutine_visit():
http_client = AsyncHTTPClient()
response = yield http_client.fetch("www.baidu.com")
print(response.body)