Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
python sqlite fetchall未返回正确的数据类型_Python_Sqlite_Fetchall - Fatal编程技术网

python sqlite fetchall未返回正确的数据类型

python sqlite fetchall未返回正确的数据类型,python,sqlite,fetchall,Python,Sqlite,Fetchall,我对fetchall返回的数据类型是否正确存在问题。一个人能行吗 con = sqlite3.connect('test.db', detect_types=sqlite3.PARSE_DECLTYPES) con = sqlite3.connect('test.db', detect_types=sqlite3.PARSE_DECLTYPES) 与con: cur = con.cursor() cur.execute("SELECT df1 FROM PLCValues") ro

我对fetchall返回的数据类型是否正确存在问题。一个人能行吗

con = sqlite3.connect('test.db', detect_types=sqlite3.PARSE_DECLTYPES)
con = sqlite3.connect('test.db', detect_types=sqlite3.PARSE_DECLTYPES)
与con:

cur = con.cursor()    
cur.execute("SELECT df1 FROM PLCValues")

rows = cur.fetchall()
#print(rows)
for row in rows:
    print (row)
print(row)
cur = con.cursor()    
cur.execute("SELECT df1 FROM PLCValues")

rows = cur.fetchone()
#print(rows)
for row in rows:
    print (row)
print(row)
返回

================= RESTART: C:/Users/zippo/Desktop/Graphit.py =================
(44.64769744873047,)
(44.691650390625,)
(44.691650390625,)
(44.471900939941406,)
(44.64769744873047,)
菲克通

与con:

cur = con.cursor()    
cur.execute("SELECT df1 FROM PLCValues")

rows = cur.fetchall()
#print(rows)
for row in rows:
    print (row)
print(row)
cur = con.cursor()    
cur.execute("SELECT df1 FROM PLCValues")

rows = cur.fetchone()
#print(rows)
for row in rows:
    print (row)
print(row)
返回:

================= RESTART: C:/Users/zippo/Desktop/Graphit.py =================
44.64769744873047
44.64769744873047

cur.fetchall()
返回元组的元组。根据数据,它似乎返回了正确的类型。您可能希望遍历单个元组以获得单个元素。

cur.fetchall()
返回元组的元组。根据数据,它似乎返回了正确的类型。您可能希望遍历单个元组以获得单个元素。

PLCValues
表中
df1
列的类型是什么?在
PLCValues
表中
df1
列的类型是什么?