1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
def result_quote():
""" Returns the values of the database records """
tpl_result = Toplevel(bg="#272727") # == Contructor Toplevel ==
tpl_result.title(" Data display")
tpl_result.geometry("1024x600")
# Text area with scrollbar
zonetext = tk.Text()
""" Returns the values of the records of the Database """
connexion = sqlite3.connect('mnesis.db')
cursor = connexion.cursor()
cursor.execute('SELECT * FROM tb_citation WHERE auteur=?', (rsltcmb,))
results = ''
for row in cursor.fetchall():
results += '\n'.join({
'Citation: {}'.format(row[3]),
'\n'
'Référence: {}'.format(row[4]),
'\n'
})
author_label = Label(tpl_result, text=str(row[1]), bg="#272727", fg="#FFFFFF", font="Calibri 16 bold")
author_label.pack()
zonetext = ScrolledText(tpl_result, width=110, height=30, padx=10, pady=10, wrap='word')
zonetext.pack()
zonetext.insert("0.0", results)
# end of the loop ---
tpl_result.mainloop()
connexion.close()
return results |
Partager