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

如何在 flask web 服务器上自动运行一个数据采集脚本

  •  
  •   mzmxcvbn · Apr 21, 2017 · 3349 views
    This topic created in 3449 days ago, the information mentioned may be changed or developed.
    想做一个工业数据监控的 B/S 系统,服务器定时采集底下硬件的数据,用户可以通过浏览器访问服务器看到实时数据。现在 flask 服务器架好了,底下数据采集的 py 脚本也写好了,但我不知道如何能让服务器一启动就一直运行那个定时采集数据的脚本,然后这个采集上来的数据应该怎么传递?
    3 replies  •  2017-04-26 08:24:03 +08:00
    MagicL
        1
    MagicL  
       Apr 22, 2017
    方法 1 :定时执行数据采集脚本
    方法 2 :采集脚本常驻运行
    MagicL
        2
    MagicL  
       Apr 22, 2017
    数据可以保存到数据库,也可以存储到本地文件,在网站里面读数据
    aznfy
        3
    aznfy  
       Apr 26, 2017
    1.把脚本写入服务器的自启动服务项里
    2.采集的数据存数据库
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   897 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 18:49 · PVG 02:49 · LAX 11:49 · JFK 14:49
    ♥ Do have faith in what you're doing.