我有一個運行python代碼的樹莓模塊。現在我不得不從它異步調用Web服務。但是,當我寫的代碼,並執行給像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異步請求請求]可能的重複(http://stackoverflow.com/questions/9110593/asynchronous-requests-with-python-requests) – jfs