推荐学习书目
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 · May 9, 2017 · 1683 views
    This topic created in 3336 days ago, the information mentioned may be changed or developed.

    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 机器上的这些查询结果信息(最好能包括查询语句),通过邮件发送出去?

    请问有这样的范例吗?

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2734 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 46ms · UTC 05:17 · PVG 13:17 · LAX 22:17 · JFK 01:17
    ♥ Do have faith in what you're doing.