0
我遵循grequests usage example,但我試圖添加一些進度反饋。已完成請求的百分比。我怎麼能做到這一點?在Grequests任務中添加進度反饋
import grequests
urls = [
'http://www.heroku.com',
'http://python-tablib.org',
'http://httpbin.org',
'http://python-requests.org',
'http://kennethreitz.com'
]
def feedback(r, **kwargs):
print "%s fetched." % r.url
return r
rs = (grequests.get(u, callback=feedback) for u in urls)
res = grequests.map(rs)
退房:http://stackoverflow.com/questions/3173320/text-progress-bar-in-the-console如何使反饋,但真正的問題是調用.map塊。 – domoarrigato