V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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
617450941
V2EX  ›  Python

python 怎么开一个 api 接口给 php post json 的方式调用 获取 linux 的 cpu 负载 网速的信息 求示例代码

  •  
  •   617450941 · 2015-10-21 09:23:16 +08:00 · 2575 次点击
    这是一个创建于 3132 天前的主题,其中的信息可能已经有所发展或是发生改变。
    3 条回复    2015-10-29 23:49:26 +08:00
    just1
        1
    just1  
       2015-10-21 19:09:11 +08:00 via Android
    我是这样的:
    <?php
    echo shell_exec(python xxxx.py);
    ?>
    617450941
        2
    617450941  
    OP
       2015-10-21 21:15:17 +08:00
    这个要是多节点就不行了 比如我有多台 linux 服务器
    huson
        3
    huson  
       2015-10-29 23:49:26 +08:00
    写个 python 程序 记录 client 机器数据 发送到 server , server 存到数据库 ,然后 php 去读数据库
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2464 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 13:44 · PVG 21:44 · LAX 06:44 · JFK 09:44
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.