I have a school project (We’re allowed help from any source, not cheating) to create a GUI using tkinter and read in a .db file to print the results in the GUI. The .db file is a list of game details. I have completed the code to read the .db file and the code for the GUI. We’re supposed to be able to sort and search the data but i can’t even get this part finished in ordre to start that. However, for the final part when I have to print the list in the GUI, only the final result in the list is being displayed. The program has to be finished for 1 week today (26 January 2021) and I just need help with this final part. This is my first time using tkinter so I am aware the GUI is very simple !
I just need all the results from the list to be printed instead of just the last result.
I’ll attach my code below:
indent preformatted text by 4 spaces import sqlite3
from tkinter import *
from tkinter import messagebox
db = sqlite3.connect(‘gamesArchive.db’)
global c c = db.cursor() global tableName tableName = 'games'
c.execute(’’‘SELECT * FROM games’’’)
for row in c.fetchall():
window = Tk()
window.title(“Welcome to Zach’s Game Archive!”)
lbl = Label(window, text=“Click the box to view the game archives”, font=(“Arial Bold”, 25))
gamesData = getAllGames(db)
for game in gamesData:
lbl.configure(text= game, font=(“Arial Bold”, 8))
btn = Button(window, text=“Click Me”, command=clicked, bg=“orange”, fg=“red”, height = 10, width = 20)