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

pychram 能不能自动重启报错的 py 文件

  •  
  •   yth492300648 · Mar 26, 2019 · 1822 views
    This topic created in 2740 days ago, the information mentioned may be changed or developed.
    RT 做需要长时间挂机的爬虫时间长了可能报错
    但是每次重新点运行还是可以正常运行
    3 replies  •  2019-04-02 09:23:14 +08:00
    leavic
        1
    leavic  
       Mar 27, 2019 via Android
    你就不能把错误休掉?
    ginyan
        2
    ginyan  
       Mar 27, 2019
    用一个 try 和 except 把错误捕捉下来,sleep 几分钟,然后在 except 里面再次调用函数就可以啦。
    1462326016
        3
    1462326016  
       Apr 2, 2019
    可能你需要 supervisor 来启动 Python 进程,可以在意外退出的情况下自动重启
    附送 github 链接: https://github.com/Supervisor/supervisor
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1300 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 16:54 · PVG 00:54 · LAX 09:54 · JFK 12:54
    ♥ Do have faith in what you're doing.