How can i covert a 3x3 grid from python to tkinter
Question: SO I have this piece of code and it only prints out in the python shell, I
would like to know how I can get the words and put them into a grid using
labels in tkinter. Sorry for my lack of explanation.

    
    
    import random
        with open('Words.txt') as f:
            words = random.sample([x.rstrip() for x in f],9)
            grid = [words[i:i +3] for i in range(0, len(words),3)]
            for x,y,z in grid:
                print(x,y,z)
    


Answer: This should get you started. I generally use pack for my projects. But for
this I would suggest grid because it allows you to position your labels
easily.

    
    
    import tkinter as tk
    
    
    words = [['Word 1', 'Word 2', 'Word 3'],\
             ['Word 4', 'Word 5', 'Word 6'],\
             ['Word 7', 'Word 8', 'Word 9']]
    
    root = tk.Tk()
    
    for i, (x, y, z) in enumerate(words):
        tk.Label(root, text=x).grid(row=i, column=0)
        tk.Label(root, text=y).grid(row=i, column=1)
        tk.Label(root, text=z).grid(row=i, column=2)
    
    
    root.mainloop()
    

