I'm trying to create simple GUI like this:
- three set of label, entry, and READ button, one set for one row
- when READ button is pressed, the value of entry will be displayed on label. But all Read button only read from the last entry and displayed on last label. Here is my script:
import tkinter as tk
main = tk.Tk()
label = [None]*3
entry = [None]*3
for j in range(3):
label[j] = tk.StringVar()
tk.Label(main, textvariable = label[j], relief = 'raised', width = 7).place(x = 5, y = 40+30*j)
entry[j] = tk.Entry(main, width=8)
entry[j].place(x=80, y=40 + 30 * j)
tk.Button(main, text="READ", pady=0, padx=10, command= lambda: label[j].set(entry[j].get())).place(x=150, y=40 + 30 * j)
main.mainloop()