分秒必争

个人技术博客,笔记,杂谈之地

« EXCEL不用替换去除vlookup公式留下的#N/A教你对付响一声电话 »
Feb
26

Python连接MSSqlserver

需要pymssql模块

模块下载地址:http://pymssql.sourceforge.net/

例子:

import pymssql
con=pymssql.connect(host='127.0.0.1',user='sa',password='',database='dbname')
cur=con.cursor()

cur.execute('select count(*) from bokewu_table')
for i in  cur.fetchall():
    for j in i
        print j #为什么这里用2次for ,是因为能让中文完整的显示,我就是因为这里少一次循环而整了半天不能显示中文
print cur.fetchall()
cur.close()
con.close()

 

Share
« EXCEL不用替换去除vlookup公式留下的#N/A教你对付响一声电话 »
  • 相关文章:

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

日历

Channels

Categories

Comments

Previous

Powered By Z-Blog 1.8 Walle Build 100427  Copyright www.djhui.net. Some Rights Reserved. 浙ICP 9017588