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
wangyu8460958
V2EX  ›  Python

使用 A 机器上的 Python 脚本将 B 机器(DB Server)上的查询信息通过邮件发送出去

  •  
  •   wangyu8460958 · 2017-05-09 21:29:39 +08:00 · 1138 次点击
    这是一个创建于 2551 天前的主题,其中的信息可能已经有所发展或是发生改变。

    B 机器上查询到如下信息: mysql> select count(),rating_score from tmp.task where task_priority = 'normal' and trackingWebsite_id = '7' and date_format(created_at,'%Y-%m-%d') = date_format(now(),'%Y-%m-%d') group by rating_score having count() > 2 order by rating_score desc; +----------+--------------+

    | count(*) | rating_score |

    +----------+--------------+

    | 40 | 300 |

    | 30 | 200 |

    | 20 | 100 |

    | 10 | 50 |

    | 5 | 40 |

    | 4 | 30 |

    | 3 | 0 |

    | 2 | -1 |

    +----------+--------------+

    我如何通过 A 机器上的 python 脚本将 B 机器上的这些查询结果信息(最好能包括查询语句),通过邮件发送出去?

    请问有这样的范例吗?

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   980 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 23:36 · PVG 07:36 · LAX 16:36 · JFK 19:36
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.