Is there a way to display data taken from my database in terms of table and that i can actually copy the individual contents of? using listbox and scrollbar currently i defined a function logs and gave looped thru it like this :
def logs():
log = Toplevel(root)
log.title('View all customers')
con = mysql.connect(host='localhost', user='root',
password='*****', database='BOOK')
c = con.cursor()
c.execute("SELECT * FROM library")
result = c.fetchall()
for index, x in enumerate(result):
num = 0
for y in x:
lookup_label = Label(log, text=y)
lookup_label.grid(row=index+1, column=num)
num +=1
l1 = Label(log,text='ID',font=font_text)
l2 = Label(log,text='S_ID',font=font_text)
l3 = Label(log,text='S_NAME',font=font_text)
l4 = Label(log,text='B_NAME',font=font_text)
l5 = Label(log,text='Date Taken',font=font_text)
l6 = Label(log,text='Date_Returned',font=font_text)
l7 = Label(log,text='Status',font=font_text)
btn_ext = Button(log,text='Exit',font=font_text,command=log.destroy,borderwidth=2,fg='#eb4d4b')
l1.grid(row=0,column=0,padx=20)
l2.grid(row=0,column=1,padx=20)
l3.grid(row=0,column=2,padx=20)
l4.grid(row=0,column=3,padx=20)
l5.grid(row=0,column=4,padx=20)
l6.grid(row=0,column=5,padx=20)
l7.grid(row=0,column=6,padx=20)
btn_ext.grid(row=index+2,columnspan=7,ipadx=540)
is there any alternatives to this if not listbox? to make tables? Thanks in advance :)