def list_bd(): conn = funcionesBD.sqlite3.connect("foro.db") conn.text_factory = str cursor = conn.execute("""SELECT * FROM FORO """) ventana = funcionesTkinter.ventanaResultados(200, 150, 200, 150) lb = ventana[0] sc = ventana[1] for row in cursor: lb.insert(END, "Titulo :" + row[1]) lb.insert(END, "Autor: " + row[2]) lb.insert(END, "Fecha: " + row[3]) lb.insert(END, '') conn.close() lb.pack(side=LEFT, fill=BOTH) sc.config(command=lb.yview)
def activosBD(): conn = funcionesBD.sqlite3.connect("foro.db") conn.text_factory = str cursor = conn.execute( """SELECT * FROM FORO ORDER BY RESPUESTAS DESC LIMIT 10 """) ventana = funcionesTkinter.ventanaResultados(200, 150, 200, 150) lb = ventana[0] sc = ventana[1] for row in cursor: lb.insert(END, "Titulo :" + row[1]) lb.insert(END, "Autor: " + row[2]) lb.insert(END, "Fecha: " + row[3]) lb.insert(END, "Respuestas: " + str(row[5])) lb.insert(END, "Visitas: " + str(row[6])) lb.insert(END, '') conn.close() lb.pack(side=LEFT, fill=BOTH) sc.config(command=lb.yview)