标签:ar os sp for on bs line python nbsp
#!/usr/bin/python
import csv
import cx_Oracle
tns_name = cx_Oracle.makedsn(‘192.168.1.230‘,‘1521‘,‘hfpboc‘)
db = cx_Oracle.connect(‘hfpboc‘,‘hfpboc‘,tns_name)
cursor = db.cursor()
f = open("cardacc.csv","w")
writer = csv.writer(f,lineterminator="\n",quoting=csv.QUOTE_NONNUMERIC)
r = cursor.execute("SELECT * FROM t_inf_card_act")
for row in cursor:
writer.writerow(row)
f.close()
标签:ar os sp for on bs line python nbsp
原文地址:http://my.oschina.net/u/2252538/blog/344121