推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
niselover
V2EX  ›  Python

同时发出多个相同请求, 如何区别这些请求的返回?

  •  
  •   niselover · Mar 11, 2022 · 3541 views
    This topic created in 1665 days ago, the information mentioned may be changed or developed.
    res_list = grequests.map(grequests.post(url, data=json.dumps(data1), headers=header) for i in range(100))
    

    能否从返回值中区分是第几个请求?

    3 replies  •  2022-03-11 23:20:29 +08:00
    killergun
        1
    killergun  
       Mar 11, 2022
    req id
    dcsuibian
        2
    dcsuibian  
       Mar 11, 2022
    res_list 列表的下标不就是了吗?
    ch2
        3
    ch2  
       Mar 11, 2022
    按下标取对应的响应,不过你的例子,本来就没有区别
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1051 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 17:39 · PVG 01:39 · LAX 10:39 · JFK 13:39
    ♥ Do have faith in what you're doing.