this is my first time ever coding in python and I'm trying to make a grid of buttons each with a word on it. I want to store the word that is on the button in an array when the user presses the button, how can I go about doing this? any advice is much appreciated. I'm trying to append the word into an array but it's putting the whole list of names into that array, not just the button I press but the whole list of words.
import tkinter as tk
from tkinter import *
from tkinter import ttk
root = tk.Tk()
list = []
root.title("grid() method")
root.geometry("390x844")
frame = tk.Frame(root, bg="white")
frame.place(relwidth=390,relheight=844)
#the text on buttons
Word =[['Adventurous', 'Creative', 'Artistic', "Curious", "Abstract"],
["Self-Disciplined", "Organized", "Plan-Driven", "Aware", "Detail Focused"],
["Energetic", "Center of Attention", "Assertive", "Impulsive", "Sociable"],
["Empathetic", "Trusting", "Honest", "Helping", "Put others first"],
["Stress Easy", "Moody", "Worrisome", "Emotionally Unstable", "Irritable"]]
#making 1 button per element in Word
for w in range(len(Word)):
for a in range(len(Word)):
button1 = tk.Button(root,height =4,width=5,bd=6,padx=18.50,pady=18.50)
button1.grid(row=w,column=a)
button1.config(text=Word[w][a], justify =LEFT, command= list.append(Word[w][a])) #trying to put the word on the button into list[]
root.mainloop()
print(list)