Python连接数据库查询
2016-06-29 09:48
567 查看
<pre name="code" class="python"># set default encoding to utf-8 import sys reload(sys) sys.setdefaultencoding( "utf-8") from util.db import db from util.logger import logger from sqlalchemy import text if __name__ == '__main__': q = text(""" select * from test where id in ( :param ) """) param1_value = [] rows = db.harbor.execute(q, {'param': "27"}).fetchall() if rows is not None and len(rows) > 0: logger.debug("--------%s" % len(rows)) else: logger.debug("========>>>None")
相关文章推荐
- python数据挖掘领域工具包
- python大规模数据处理技巧之三:数据库操作篇
- PYTHONIOENCODING 信用评分 2016.06.28回顾
- 软件工程师关注的播客
- python的一个小游戏之五子棋
- error: could not create '/Library/Python/2.7/site-packages/xlrd': Permission denied
- python中collections 模块里的defaultdict()函数
- 13.5 logging--Python灵活的日志功能
- 使用Python计算物品的流行度和用户所评物品的平均流行度
- Python yield的使用方法
- Python中的yield
- python面向对象
- 【python】迭代和生成器
- Deep Residual Networks for Image Classification with Python + NumPy
- python入门笔记1
- 量化-使用python计算各类移动平均线
- Python通过RabbitMQ服务器实现交换机功能的实例教程
- Python操作RabbitMQ服务器实现消息队列的路由功能
- 【Python学习日记】【设计模式】装饰器(装饰模式)
- 量化-windows下如何安装Python、pandas