I have created a MySQL database with a users name, score, and date. I want to pack 10 rows of data on to a tkinter box I have made, however I do not know the best way of doing this. I have tried making the information a label:
def print_result():
global other_information
other_information = 3
myresult = mycursor.fetchall()
for result in myresult:
global result_label
result_label = Label(text=result)
result_label.pack()
back_radio.pack()
and while this successfully packs the rows of data on the tkinter box, when I try pack_forget(), only the final row unpacks and the rest of the data is left on the tkinter box. This is my code for unpacking:
elif other_information == 3:
result_label.pack_forget()
back_radio.pack_forget()
display()
So I decided to try put it in a text widget:
def print_result():
myresult = mycursor.fetchall()
for result in myresult:
global result_text
result_text = Text(game, height=300, width=300)
result_text.insert('1.0', result)
result_text.pack()
back_radio.pack()
However this only packed one row of data, and my radio buttons would not show up. What is the best way to display the rows of data on a tkinter box and how would I unpack it?
Thanks!