【发布时间】:2014-04-25 07:06:39
【问题描述】:
我有一个覆盆子模块,其中运行 python 代码。现在我必须从中异步调用 Web 服务。但是当我编写代码并执行时会出现类似
的错误 Traceback (most recent call last):
File "async_ws.py", line 3, in <module>
from requests import async
ImportError: cannot import name async
我的代码是这样的
import json
import requests
from requests import async
urls = [
'http://python-requests.org',
'http://httpbin.org',
'http://python-guide.org',
'http://kennethreitz.com'
]
rs = [async.get(u) for u in urls]
async.map(rs)
请帮帮我
【问题讨论】:
标签: python web-services asynchronous web raspberry-pi