@
catcn @
aggron 我这样写了下 还是只能查询一次。然后就。。。。读不出数据
class DatabaseManager(object):
def __init__(self, db):
self.conn = sqlite3.connect(db,check_same_thread = False)
self.conn.execute('pragma foreign_keys = on')
self.conn.commit()
self.cur = self.conn.cursor()
def query(self, arg):
self.cur.execute(arg)
self.conn.commit()
return self.cur
def __del__(self):
self.conn.close()
ChaX = DatabaseManager("DB/ershou.db")
DBshuC = ChaX.query("SELECT post,link,name,date from caiji")