python connector user guide

This commit is contained in:
fang 2019-12-05 10:06:56 +08:00
parent ccb02180f4
commit a0b79bd771
2 changed files with 2 additions and 2 deletions

View File

@ -345,7 +345,7 @@ c1.execute('select * from tb')
data = c1.fetchall()
# data is a list of returned rows with each row being a tuple
numOfRows = c1.rowcount
numOfCols = c1.descriptions
numOfCols = len(c1.description)
for irow in range(numOfRows):
print("Row%d: ts=%s, temperature=%d, humidity=%f" %(irow, data[irow][0], data[irow][1],data[irow][2])

View File

@ -341,7 +341,7 @@ c1.execute('select * from tb')
data = c1.fetchall()
# 返回的结果是一个列表,每一行构成列表的一个元素
numOfRows = c1.rowcount
numOfCols = c1.descriptions
numOfCols = len(c1.description)
for irow in range(numOfRows):
print("Row%d: ts=%s, temperature=%d, humidity=%f" %(irow, data[irow][0], data[irow][1],data[irow][2])