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

怎么随机休息几秒呢

  •  
  •   911speedstar · Mar 9, 2019 · 3466 views
    This topic created in 2756 days ago, the information mentioned may be changed or developed.
    原代码里是 time.sleep(5),

    怎么改为让程序随机休息几秒呢,比如这次循环是休息 1s,下次就 3s,下下次 5s。这样子的
    ClutchBear
        1
    ClutchBear  
       Mar 9, 2019   ❤️ 1
    random。randint ( 1,5 )
    Heyavc
        2
    Heyavc  
       Mar 10, 2019
    random 随机数
    wanderpoet
        3
    wanderpoet  
       Mar 10, 2019 via iPhone
    sleep + random
    yingfengi
        4
    yingfengi  
       Mar 10, 2019   ❤️ 2
    随机卡顿好下次优化吗 (狗头.gif )
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2397 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 11:43 · PVG 19:43 · LAX 04:43 · JFK 07:43
    ♥ Do have faith in what you're doing.