Python 3, Tkinter, How to update button text
Question: Im trying to make it so that when the user clicks a button, it becomes "X" or
"0" (Depending on their team). How can I make it so that the text on the
button is updated? My best idea so far has been to delete the buttons then
print them again, but that only deletes one button. Here's what I have so far:

    
    
    from tkinter import *
    
    BoardValue = ["-","-","-","-","-","-","-","-","-"]
    
    window = Tk()
    window.title("Noughts And Crosses")
    window.geometry("10x200")
    
    v = StringVar()
    Label(window, textvariable=v,pady=10).pack()
    v.set("Noughts And Crosses")
    
    def DrawBoard():
        for i, b in enumerate(BoardValue):
            global btn
            if i%3 == 0:
                row_frame = Frame(window)
                row_frame.pack(side="top")
            btn = Button(row_frame, text=b, relief=GROOVE, width=2, command = lambda: PlayMove())
            btn.pack(side="left")
    
    def PlayMove():
        BoardValue[0] = "X"
        btn.destroy()
        DrawBoard()
    
    DrawBoard()
    window.mainloop()
    


Answer: The Button widget, just like your Label, also has a `textvariable=` option.
You can use `StringVar.set()` to update the Button. Minimal example:

    
    
    import tkinter as tk
    
    root = tk.Tk()
    
    def update_btn_text():
        btn_text.set("b")
    
    btn_text = tk.StringVar()
    btn = tk.Button(root, textvariable=btn_text, command=update_btn_text)
    btn_text.set("a")
    
    btn.pack()
    
    root.mainloop()
    

