推荐学习书目
› 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 · 3600 views
    This topic created in 2801 days ago, the information mentioned may be changed or developed.
    原代码里是 time.sleep(5),

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