def execute(self, sql):
try:
cursor = self.db.cursor()
cursor.execute(sql)
self.db.commit()
except (AttributeError, MySQLdb.OperationalError):
self.connect()
cursor = self.db.cursor()
cursor.execute(sql)
self.db.commit()
return cursor
评论列表
文章目录