V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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 · 3242 views
    This topic created in 1508 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   ·   Solana   ·   4282 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 77ms · UTC 00:57 · PVG 08:57 · LAX 17:57 · JFK 20:57
    ♥ Do have faith in what you're doing.