[Python] Tkinter Text widget with grid management. How to retrieve the edited data? Python...

Discussão em 'Python' iniciado por Stack, Junho 24, 2025.

  1. Stack

    Stack Membro Participativo

    I've discovered the Tkinter Text widget, used with the grid manager. I successfully created a table and populated it with a numpy array. Now I'm trying to figure out how to retrieve the edited values from the grid. Here is my current code:

    for x in range(5):
    for y in range(6):
    text = tk.Text(root, width=7, height=2)
    text.grid(row=x,column=y)
    text.insert(tk.END, _6m[x][y])


    I've tried several ways to access the grid data, with the last method of:

    print(text.grid[0][0].get())


    Which didn't work. I would like to repopulate my _6m array with the edited data.

    Continue reading...

Compartilhe esta Página