Python 没有错误,但未获得预期的输出
程序将返回一个列表/元组,每行中都有列名和相应的值。但问题是,当我打印它时,我会看到如下内容:Python 没有错误,但未获得预期的输出,python,sqlite,tkinter,Python,Sqlite,Tkinter,程序将返回一个列表/元组,每行中都有列名和相应的值。但问题是,当我打印它时,我会看到如下内容: import sqlite3 class DBConnect(): def __init__(self): self.db=sqlite3.connect("Registrations.db") self.db.row_factory=sqlite3.Row self.db.execute("create table
import sqlite3
class DBConnect():
def __init__(self):
self.db=sqlite3.connect("Registrations.db")
self.db.row_factory=sqlite3.Row
self.db.execute("create table if not exists Ticket(ID integer Primary key autoincrement,name
text,gender text,comment text)")
self.db.commit()
def Add(self,Name,gender,comment):
self.db.row_factory=sqlite3.Row
self.db.execute("insert into Ticket(name,gender,comment) values(?,?,?)",(Name,gender,comment))
self.db.commit()
return "DATA ADDED SUCCESFULLY"
def Show(self):
cursor=self.db.execute("select * from Ticket")
print(type(cursor))
return cursor.fetchall()
[,,,,,]
并没有错误,但从表中选择数据将返回其地址。我如何解决这个问题
[<sqlite3.Row object at 0x000002C0748D6D50>, <sqlite3.Row object at 0x000002C0748D68F0>, <sqlite3.Row
object at 0x000002C0748D6C50>, <sqlite3.Row object at 0x000002C0748D6D10>, <sqlite3.Row object at
0x000002C0748D6890>, <sqlite3.Row object at 0x000002C0748D6D90>, <sqlite3.Row object at
0x000002C0748D6870>, <sqlite3.Row object at 0x000002C0748D6750>, <sqlite3.Row object at
0x000002C0748D6910>, <sqlite3.Row object at 0x000002C0748D6A70>]