推荐学习书目
› 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
holajamc
V2EX  ›  Python

求教一个 gevent 相关问题

  •  1
     
  •   holajamc · Nov 24, 2016 · 2769 views
    This topic created in 3638 days ago, the information mentioned may be changed or developed.

    在使用 gevent 时候真的很佩服它的强大,但是在使用中有一个问题一直比较头疼,如图:

    不知道有没有什么更好的写法~

    7 replies  •  2016-11-29 10:05:11 +08:00
    mgna17
    mgna17
    Nov 24, 2016❤️1
    1
    比如。。。用列表生成式么
    [gevent.spawn(item) for item in tmp]
    NaVient
    NaVient
    Nov 24, 2016❤️1
    2
    楼主应该才开始写 python
    ```python
    gevet.joinall([gevent.spawn(tmp[i]) for i in range(5)])
    ```
    hastelloy
    hastelloy
    Nov 24, 2016 via Android❤️1
    3
    我不厚道的觉得楼主不但刚学 python ,而且是刚学编程,怎么的也可以是 for i.. : temp[i]吧
    est
    est
    Nov 24, 2016❤️1
    4
    gevent.pool
    holajamc
    holajamc
    OP
    Nov 25, 2016
    5
    @mgna17
    @NaVient
    @hastelloy
    @est
    谢谢各位回复,刚刚学习 Python 不久~
    R4rvZ6agNVWr56V0
    R4rvZ6agNVWr56V0
    Nov 25, 2016❤️1
    6
    holajamc
    holajamc
    OP
    Nov 29, 2016
    7
    @GeekGao 谢谢指点~
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4601 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 47ms · UTC 03:36 · PVG 11:36 · LAX 19:36 · JFK 22:36
    ♥ Do have faith in what you're doing.