

#-*-coding:UTF-8-*-
import sys, string, Sybase
db = Sybase.connect('sybaseconnect', 'sa', 'xxxxxx', 'master',bulkcopy=1, auto_commit=1,locale = 'cp850')
i=0
for r in db.bulkcopy('table', out=1):
i=i+1
for userid in r:
print str(userid)
print '------------------'
print i
在Pydev和Eclipse环境中中文字串显示为乱码,但是在windows窗口中及重定向到文件中均为正常汉字。
原创文章,作者:苏葳,如需转载,请注明出处:https://www.swmemo.com/258.html
